[FieldTrip] ft_channelrepair with eeg data

"Jörn M. Horschig" jm.horschig at donders.ru.nl
Fri Jul 8 19:15:10 CEST 2011


Hey Tom,

apart from the fact that we indeed decided to change ft_channelrepair to 
require cfg.neighbours to be user specified (I committed that change 
just a few hours before your message), you do need data.elec 
information. data.elec should contain sensor information like position 
for your data. As an extremely dirty workaround, you could use the the 
EEG layout templates as following (I did that for testing ft_channelrepair):

cfg.layout = 'EEG1010.lay';
data.elec = ft_prepare_layout(cfg);
data.elec.pnt = lay.pos;

I do not whether there is a more appropriate way available ;)

Best,
Jörn

On 7/8/2011 4:17 PM, Marshall, T.R. (Tom) wrote:
> Thanks Stephen. ft_neighbourselection looks like it might be what I need.
>
> So now I tried this:-
>
> ###
>
>     channels_to_repair={'FT9', 'CPz'};
>     layout_file=('H:\common\matlab\fieldtrip\template\layout\EEG1010.lay');
>
>     cfg=[];
>     cfg.layout=layout_file;
>     cfg.badchannel=channels_to_repair;
>
>     cfg.neighbours = ft_neighbourselection(cfg, data);
>
>     data=ft_channelrepair(cfg, data);
>
> ###
>
> But what that gave me was:-
>
> ###
>
>     ??? Reference to non-existent field 'elec'.
>
>     Error in ==>  ft_channelrepair at 92
>       sens = data.elec;
>
> ###
>
> This is the field that my eeg data don't have, that I mentioned in my first post. What is this data.elec structure supposed to contain/look like, and does a function exist that will create it for me?
>
> Best,
> Tom
>
> ----- Original Message -----
> From: "Stephen Whitmarsh"<stephen.whitmarsh at gmail.com>
> To: "Email discussion list for the FieldTrip project"<fieldtrip at donders.ru.nl>
> Sent: Friday, 8 July, 2011 3:44:44 PM
> Subject: Re: [FieldTrip] ft_channelrepair with eeg data
>
> He Tom,
>
> Wow, look what was made this morning by Jorn at basecamp:
>
> http://fieldtrip.fcdonders.nl/faq/how_can_i_define_neighbouring_sensors
>
> Cheers,
>
> Stephen (Pte(T))
>
>
>
> On 8 July 2011 15:28, Marshall, T.R. (Tom)<t.marshall at fcdonders.ru.nl>  wrote:
>> Hi Fieldtrip-warriors,
>>
>> I'm trying to use function ft_channelrepair to remove and reinterpolate some bad channels in my eeg data. My syntax looks like this:-
>>
>> ###
>>
>>    channels_to_repair={'FT9', 'CPz'};
>>
>>    cfg=[];
>>    cfg.neighbourdist = 4;
>>    cfg.badchannel=channels_to_repair;
>>
>>    data=ft_channelrepair(cfg, data);
>>
>> ###
>>
>> Running this produces the following error msg:
>>
>> ###
>>
>>    ??? Error using ==>  ft_checkconfig at 157
>>    The field cfg.neighbours is required
>>
>>
>>    Error in ==>  ft_channelrepair at 58
>>    cfg = ft_checkconfig(cfg, 'required', {'neighbours'});
>>
>> ###
>>
>> It seems that the underlying function ft_checkconfig requires a field 'cfg.neighbours' that ft_channelrepair does not. But... what value should be specified here?
>>
>> I also see the following in the help file for ft_channelrepair:-
>>
>> ###
>>
>>      Since a nearest neighbour average is used, the input should contain
>>      a gradiometer or electrode definition, i.e. data.grad or data.elec.
>>
>> ###
>>
>> What exactly is this 'electrode definition'? A layout file for the electrodes? Are there prespecified templates or should I supply my own, and is there a function to correctly add this field to the data structure?
>>
>> I'm using a standard 10-10 64-electrode layout.
>>
>> Best,
>>
>> --
>> Tom Marshall, MSc.
>> Neuronal Oscillations Group, Donders Centre for Cognitive Neuroimaging
>> tel: +31(0)243668487
>> email: t.marshall at fcdonders.ru.nl
>> postal: PO Box 9101, 6500HB, Nijmegen, The Netherlands
>> visiting: Kapittelweg 29, 6525EN, Nijmegen, The Netherlands
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> 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

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