[FieldTrip] repairing bad channels

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Tue Aug 5 14:10:59 CEST 2014


Hi Hweeling,

reading the help of the function might help ;)

>    The EEG or MEG sensor positions can be present in the data or can be specified as
>      cfg.elec          = structure with electrode positions, seeFT_DATATYPE_SENS  <http://fieldtrip.fcdonders.nl/reference/ft_datatype_sens>
>      cfg.grad          = structure with gradiometer definition, seeFT_DATATYPE_SENS  <http://fieldtrip.fcdonders.nl/reference/ft_datatype_sens>
>      cfg.elecfile      = name of file containing the electrode positions, seeFT_READ_SENS  <http://fieldtrip.fcdonders.nl/reference/ft_read_sens>
>      cfg.gradfile      = name of file containing the gradiometer definition, seeFT_READ_SENS  <http://fieldtrip.fcdonders.nl/reference/ft_read_sens>

The cross-reference to ft_datatype_sens should help you to resolve your 
issue (and check out the FieldTrip/template directory)

Best,
Jörn


On 8/5/2014 1:53 PM, Hwee Ling Lee wrote:
> Dear all,
>
> I'm trying to repair the bad channels by using the ft_channelrepair 
> function for 64 channels EEG data.
>
> I've set up the structure like this:
>
>
> load('/home/leeh/Programs/fieldtrip-20140803/template/layout/easycapM11.mat');
>
>     cfg_neighb.method = 'distance';
>     cfg_neighb.layout = lay;
>     neighbours = ft_prepare_neighbours(cfg_neighb, data4);
>
>     cfg = [];
>      if strcmp('S004', dir_analysis{sub}) == 1
>         cfg.badchannel = {'C4', 'TP9', 'FC4', 'C2', 'F4'};
>      end
>      cfg.trials = 'all';
>      cfg.method = 'average';
>      cfg.neighbours = neighbours;
>      cfg.elec = lay.pos;
>      data5 = ft_channelrepair(cfg, data4);
>
> However, I get an error message:
>
> ttempt to reference field of non-structure array.
> Error in ft_datatype_sens (line 136)
> nchan = length(sens.label);
> Error in ft_checkconfig (line 246)
>   cfg.elec = ft_datatype_sens(cfg.elec);
> Error in ft_preamble_trackconfig (line 38)
> cfg = ft_checkconfig(cfg, 'trackconfig', 'on');
> Error in ft_preamble (line 54)
>   evalin('caller', ['ft_preamble_' cmd]);
> Error in ft_channelrepair (line 76)
> ft_preamble trackconfig
>
> Can someone please help me?
>
> Thank you very much!
>
> Best regards,
> Hweeling
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: jm.horschig at donders.ru.nl
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands




More information about the fieldtrip mailing list