[FieldTrip] ft_channelrepair issue

Arkadiy Lobov arkadij.lobov at icloud.com
Thu Mar 24 20:16:05 CET 2022


Hello,

My name is Arkadij, and I am a research assistant in SELab, the University of Essex in the UK. Currently, I am learning how to pre-process and analyse EEG data. 

I am having a problem trying to repair a bad channel. The only method I can use from ft_channelrepair is "average". The other options (weighted, spline, slap) lead to an error. So please check the script and an error message:

if rd.repchan(s)
            cfg =[];
            cfg.channel = {'all', '-VEOG', '-HEOG','-ECG'};
            cfg.method = 'distance';
            cfg.layout = customlay;
            neighbours = ft_prepare_neighbours(cfg, data);
            cfg =[];
            cfg.neighbours = neighbours;
            cfg.method = 'weighted'; 
            cfg.elec = 'easycap_custom.mat';
            cfg.senstype = 'eeg';
            cfg.trials = 'all';
            if strcmp (rd.subj,'8'), cfg.neighbours(1).label = 'C2';  cfg.neighbours(1).neighblabel = {'FC2', 'C4','CP2','Cz'}; cfg.badchannel = {'C2'}; end
            data = ft_channelrepair(cfg, data);
        end  

Unable to perform assignment because the size of the left side is 64-by-3 and the size of the right side is 64-by-2.

Error in ft_datatype_sens (line 454)
        sens.chanpos(selsens,:) = chanpos(selpos,:);

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 614)
sens = ft_datatype_sens(sens);

Error in ft_fetch_sens (line 149)
  sens = ft_read_sens(cfg.elec, 'senstype', 'eeg');

Error in ft_channelrepair (line 168)
  sens = ft_fetch_sens(cfg, data);


I've followed the error all the way down to the ft_datatype_sens, which says that channels position should be Mx3 structure. However, as I understood, configuration for EEG cap layout is usually done in 2D. So, my humble interpretation of the error is that ft_datatype_sens requires a 3-column channels position structure (3D?), whereas the layout I am using has only 2 columns (64x2). 

Also, I've created a 3D layout through ft_prepare_layout and another 3-column layout through Matlab coding, both based on data channel labels. None of these layouts helped to solve an issue. I've got the same error. I am only learning about EEG pre-processing, and maybe the 'average' approach for repairing bad channels would be sufficient. However, even after interpolating with the 'average' approach, the signal of the bad channel looks completely irrelevant. 

I will appreciate any suggestions about this issue, as well as comments regarding my interpretations. Thank you!

with best wishes
Arkadij
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220324/a54d9896/attachment.htm>


More information about the fieldtrip mailing list