[FieldTrip] ft_channelrepair with channel absent from data

Johanna Zumer johanna.zumer at gmail.com
Mon Nov 26 10:56:17 CET 2012


Hi Tom and Trippers,

To add to Jorn's more detailed answer, if you are ever in doubt as to where
to find a FT function, which may be hidden in a private directory (and
don't know which of the many private directories to search in), then
remember that you can always search for functions on the google FT code
page, which doesn't hide the private functions!

http://code.google.com/p/fieldtrip/source/browse/

and after searching for ft_fetch_sens
http://code.google.com/p/fieldtrip/source/search?q=ft_fetch_sens&origq=ft_fetch_sens&btnG=Search+Trunk

Johanna




2012/11/25 Tom Marshall <t.marshall at fcdonders.ru.nl>

>  Hi Trippers,
>
> I'm having some difficulty reinterpolating some missing channels in my
> ctf275 data. These are 2 channels that were never recorded because the
> sensors in question were switched off.
>
> Luckily, in the documentation for ft_channelrepair I find:
>
> "*For reconstructing channels that are absent in your data*, please
> define  your neighbours by setting cfg.method='template' and call
> FT_PREPARE_NEIGHBOURS *without* the data argument:
> cfg.neighbours = ft_prepare_neighbours(cfg);
> This will include channels that are missing in your in the
> neighbour-definition."
>
> I dutifully define such a neighbours structure:
>
> *cfg=[]**
> **cfg.method='template';**
> **cfg.template='CTF275_neighb.mat';**
> **n=ft_prepare_neighbours(cfg);*
>
> This structure of course contains all 275 MEG channels, including the ones
> that are missing from my data.
>
> So I try to reinterpolate:
> *
> **% get the 'full' list of channel names**
> **for i=1:length(n)**
> **    allchans{i,:}=n(i).label;**
> **end**
> **
> **% find the names of the channels that were not recorded**
> **missingchans=setdiff(allchans,data.label);**
> **
> **% repair**
> **cfg=[];**
> **cfg.missingchannel=missingchans;**
> **cfg.neighbours=n;**
> **cfg.method='spline';**
> **data_r=ft_channelrepair(cfg,data);*
>
> this fails with:
>
> *??? Error using ==> minus**
> **Matrix dimensions must agree.**
> **
> **Error in ==> ft_channelrepair at 279**
> **  d = sens.chanpos - repmat(c, numel(sensidx), 1);*
>
> length(sensidx) is 301 and length(sens.chanpos) is 273, so the error makes
> sense. However at this point I get a bit stuck as 'sens' is created in line
> 104-108 by the function 'ft_fetch_sens' which I can't find! 'help
> ft_fetch_sens', 'which ft_fetch_sens' and 'edit ft_fetch_sens' all fail.
>
> I guess I have several questions all at once:
> 1) Is it actually possible to reinterpolate MEG channels that were never
> recorded - eg because the channels were deactivated when the acquisition
> took place?
> 2) What might be causing the error I'm seeing?
> 3) Where is ft_fetch_sens?
>
> Thanks for help with any of the above!
> Best,
> Tom
>
> --
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20121126/0153d230/attachment.html>


More information about the fieldtrip mailing list