[FieldTrip] timelockgrandaverage on planar gradients

Vitória Magalhães Piai vitoria.piai at gmail.com
Fri Jul 13 15:07:10 CEST 2012

Dear all,

Until some weeks ago, I used to proceed with the following steps to 
compute ERFs:

% For each subject
dat = ft_preprocessing(cfgp, input);
dat = ft_timelockanalysis(cfgtl, dat);

cfg.method = 'template';
cfg.neighbours = ft_prepare_neighbours(cfg, dat);
cfg.planarmethod = 'sincos';
cond = ft_megplanar(cfg, dat)
cplanar{suj} = ft_combineplanar([], cond);

ga = ft_timelockgrandaverage([], cplanar{:});

I excluded some channels for some subjects.
I re-ran this script and now I'm left only with the channels that are 
common to all subjects. (I'm using the DCCN internal fieldtrip version). 
But I'm pretty sure it used to work until some time ago such that in the 
GA, I had all the planar gradients still.

I understand where it comes from, coz I get the warning that gradiometer 
info is being discarded coz it cannot be averaged.
I've found a previous post that came close (but still not there yet): 

But I'm not being able to understand the explanation in the tutorial 
about how to proceed:
"Before calculating the grand average the data of each subject can be 
realigned to standard sensor positions with *ft_megrealign 
<http://fieldtrip.fcdonders.nl/reference/ft_megrealign>*", but then it's 
unclear to me what cfg.template should be when using ft_megrealign.

So I tried (suggested by JM from another previous post)

/"Alternatively, you could construct a gradiometer structure which
//contains a meaningful average of the coil positions and orientations."

I made a grad in which grad.chanpos was an average of my participants 
I tried
cfg.template = grad;
cfg.template = grad.chanpos;
cfg.template = grad.chanori;
but I'm probably doing something wrong coz it didn't work still.
In all three cases, the error is in ft_megrealign at 174 "cell contents 
reference from a non-cell array object".

So I guess my questions are:
- what should the template be? What am I doing wrong?
- do I need to make a grad structure myself with all the averages or 
will the template do, once I get it right?

Thanx loads,

** Please consider the environment - do you really need to print? **	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120713/fd4fde5c/attachment-0001.html>

More information about the fieldtrip mailing list