[FieldTrip] layout file error after upgrading to the newest version

Marta Topor m.topor at surrey.ac.uk
Thu May 27 22:24:50 CEST 2021


Dear colleagues,

I came across a surprising error and I am struggling to figure it out.
I wrote a few scripts last year in version fieldtrip-20200409. They all worked fine, last time I worked with those scripts in that version was January 2021. I had to take care of a few other tasks since then, so the project was on pause. I had my work laptop upgraded in the meantime which meant I had to upgrade to the newest Fieldtrip version.

I started working on that same project again, in version fieldtrip-20210525, and noticed layout file issues when interpolating channels.

For a bit of background,  I am using the Mobita water-based 32 EEG electrode system. I created my own layout file in the previous Fieldtrip version which worked without any issues in all scripts.
I now have an error using the ft_channelrepair() funtion and I think it relates to the ft_read_sens() funtion.

The cfg I used:
cfg = [];
cfg.method          = 'spline';
cfg.neighbours      = neighbours_EEG;
cfg.badchannel      = badchannels_train;
cfg.senstype        = 'EEG';
cfg.elec            = layout_file;
mydata_interpolated_train = ft_channelrepair(cfg, mydata_artrm_train);


The layout file fields are:
pos: [34×2 double]
label: {34×1 cell}
width: [34×1 double]
height: [34×1 double]
outline: {1×4 cell}
mask: {[101×2 double]}
cfg: [1×1 struct]

But I can only see these fields if I use the function importdata(). When I use the function ft_read_sens() and when I try to interpolate channels, I get the following error:

Error message:
Unrecognized function or variable 'lab'.

Error in channelposition (line 352)
n = size(lab,2);

Error in ft_datatype_sens (line 438)
        [chanpos, chanori, lab] = channelposition(sens);

Error in ft_datatype_sens (line 240)
    sens      = ft_datatype_sens(sens, new_argin{:});

Error in ft_datatype_sens (line 207)
    sens      = ft_datatype_sens(sens, new_argin{:});

Error in ft_datatype_sens (line 180)
    sens      = ft_datatype_sens(sens, new_argin{:});

Error in ft_read_sens (line 539)
sens = ft_datatype_sens(sens);


There are no errors when I plot the channels using the following code though and it all looks absolutely fine:
cfg = [];
cfg.layout = layout_m; %layout_m is imported from the layout_file using the importdata() function
cfg.channel = 'eeg';
ft_layoutplot(cfg, mydata_artrm_train);


Any ideas what could be the issue here and how I could get it solved?
Thanks for your help in advance!


_________________________

Marta Topor

PhD Candidate


Room 07AC04

School of Psychology

University of Surrey

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210527/df129d41/attachment.htm>


More information about the fieldtrip mailing list