[FieldTrip] ft_channelrepair issue
Schoffelen, J.M. (Jan Mathijs)
janmathijs.schoffelen at donders.ru.nl
Fri Mar 25 08:27:13 CET 2022
Dear Arkadij,
As a PS to my previous message, if you want to learn more about the difference of a sensor description elec/grad/opto, and a layout, you can check out:
https://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described/
and
https://www.fieldtriptoolbox.org/template/layout/
Best,
JM
On 24 Mar 2022, at 20:16, Arkadiy Lobov via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:
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
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8yHtECz5aDE3ndikGhn-ykaAoymI1CTXiwe-0Gt1G5rnWiERzfewZviEuWfsXwJCBo6JYIfOGeAATUt_Pmvb-UbKWyzjgZSdj2StoQ$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220325/221327a6/attachment.htm>
More information about the fieldtrip
mailing list