[FieldTrip] cluster-based permutation stats with combined-planar neuromag data

Joram van Driel joramvandriel at gmail.com
Wed Feb 5 13:10:16 CET 2014

Hi all,

I want to do statistics on frequency domain MEG data using cluster-based
permutation testing, but I get stuck with the neighbour construction. I
have Neuromag data, 204 sensors (excluding magnetometers), on which I did
frequency analysis, after which I used ft_combineplanar to get a final set
of 102 sensors.

I have two freq cell structures corresponding to 2 conditions, 10 subjects
each (within-subject design).

I know the layout, template and neighbour approach for Neuromag is tricky
because of the different sensor types, but here's what I did:

cfg = [];

cfg_lay.layout = 'neuromag306cmb.lay';
cfg_lay.grad = freq{1}.grad;

cfg_neighb.layout = ft_prepare_layout(cfg_lay,freq{1});
cfg_neighb.method   = 'template';
cfg_neighb.template = 'neuromag306cmb_neighb.mat';

cfg.neighbours       = ft_prepare_neighbours(cfg_neighb,freq{1});
cfg.minnbchan        = 2;

... And then the cfg continues with standard settings for cluster-based
permutation testing.

When I run:
stat = ft_freqstatistics(cfg, freq{2}, freq{1});

I get the error:

??? Error using ==> findcluster at 56
invalid dimension of spatdimneighbstructmat

Error in ==> clusterstat at 185
      posclusobs = findcluster(reshape(postailobs,

Error in ==> ft_statistics_montecarlo at 361
  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ==> ft_freqstatistics at 323
  [stat, cfg] = statmethod(cfg, dat, cfg.design);

I digged into these embedded functions but can't wrap my head around what
went wrong. The later constructed cfg.connectivity seems to be empty; my
guess is that produces channeighbstructmat to be empty, which produces the
The output of ft_prepare_layout says there are on average 6.8 neighbours
per channel, and the result of ft_neighbourplot looks perfectly fine:

[image: Inline image 1]
[image: Inline image 2]

Does anybody have a suggestion how to tackle this problem?
Any help is much appreciated!


Joram van Driel, MSc.
PhD student @ University of Amsterdam
Brain & Cognition @ Department of Psychology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140205/49a8e738/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 25532 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140205/49a8e738/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 22254 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140205/49a8e738/attachment-0003.png>

More information about the fieldtrip mailing list