[FieldTrip] Fwd: Re: repairing bad channels

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Wed Aug 6 16:40:49 CEST 2014


I forgot to include the mailing list in my response to Hweeling, my 
apologies for leaving you out ;)


-------- Original Message --------
Subject: 	Re: [FieldTrip] repairing bad channels
Date: 	Wed, 06 Aug 2014 14:45:05 +0200
From: 	"Jörn M. Horschig" <jm.horschig at donders.ru.nl>
Organization: 	Donders Institute for Brain, Cognition and Behaviour, 
Radboud University Nijmegen
To: 	hweeling.lee at gmail.com



Dear Hweeling,

in FieldTrip/template there are different directories, one of the is
'elec'. The help that I copied in my last mail mentions that you can
(should) define cfg.elec, which is a particular type of
sensor-description (sens, thus ft_datatype_sens). The layout templates
in the template/layout directory are layouts, not electrode positions,
i.e. they are 2D projections of the electrodes optimized for visual
inspections, topoplots, etc. There are three ways for you to go:

1) choose a template file from the 'elec' directory and specify cfg.elec
or cfg.elecfile accordingly. The M11 cap is basically a 10-10 electrode
cap, so you could use electrode positions from any 10-10 system as a
template.

2) instead of specifying cfg.elec, you can specify cfg.layout and point
to the layout file that you want to use (just like when calling a
plotting function). FieldTrip will then extract the 2D positions and
infer neighbours from that.

3) You can set cfg.method to 'template', which will load alreay
pre-defined neighbours for your particular data, see
http://fieldtrip.fcdonders.nl/template/neighbours

Hope this helps and clarifies things :)
Best,
Jörn


On 8/6/2014 2:12 PM, Hwee Ling Lee wrote:
> Dear Jörn,
>
> Pardon my ignorance, however, I'm not exactly sure what you mean as
> I'm not an expert in matlab programming. I've checked the functions,
> but I still don't understand how I could resolve my issue.
>
> In addition, I checked on Easycap website, and find that the Montage
> 11 (or what the template directory called 'easycapM11.mat') is the
> closest fit to the cap that I used for the EEG recordings (At least
> that's what I gathered from their website).
>
> Could you please alternatively show me how you would do for repairing
> bad channels for the EEG data (an example)?
>
> Thank you.
>
> Cheers,
> Hweeling
>
>
>
> On 5 August 2014 14:10, "Jörn M. Horschig" <jm.horschig at donders.ru.nl
> <mailto:jm.horschig at donders.ru.nl>> wrote:
>
>     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 <mailto: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 <mailto:jm.horschig at donders.ru.nl>
>     Tel: +31-(0)24-36-68493 <tel:%2B31-%280%2924-36-68493>
>     Web: http://www.ru.nl/donders
>
>     Visiting address:
>     Trigon, room 2.30
>     Kapittelweg 29
>     NL-6525 EN Nijmegen
>     The Netherlands
>
>
>
>
> --
> =================================================
> Dr. rer. nat. Lee, Hwee Ling
> Postdoc
> German Center for Neurodegenerative Diseases (DZNE) Bonn
>
> Email 1: hwee-ling.lee<at>dzne.de <http://dzne.de>
> Email 2: hweeling.lee<at>gmail.com <http://gmail.com>
>
> https://sites.google.com/site/hweelinglee/home
>
> Correspondence Address:
> Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany
> =================================================


-- 
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