[FieldTrip] Neighbouring issue with ft_timelockstatistics

D.Akarca da434 at cam.ac.uk
Thu Mar 16 17:16:35 CET 2017

Dear all,

My name is Danyal Akarca, I’m a Master’s student working at Cambridge University, working at the MRC Cognition and Brain Sciences Unit.
I’m currently working on some MEG data analysis, using ft_timelockstatistics and ft_clusterplot to determine clustering of neuromag magnetometers for task-related data.

My neighbouring function is defined as follows:
cfg                           = [];
cfg.method              = ‘distance’;
cfg.neighbourdist    = 0.13;
cfg.template            = ‘neuromag306mag_neighb’;
cfg.layout                = ‘NM306mag.lay’
cfg.channel             = ‘all'
neighbours              = ft_prepare_neighbours(cfg, MagGM_Control_Deviant); % The input data here is one of the grand means computed with ft_timelockgrandaverage

This provides me with an average of 5.5 neighbours per channel, and upon inspection with ft_neighbourplot, it looks very reasonable.

I then went on to compute statistics, using ft_timelockstatistics as follows

cfg                           = [];
cfg.channel             = ‘all’;
cfg.neighbours        = neighbours;
cfg.latency              = [0.1 0.54]
cfg.method             = ‘montecarlo’;
cfg.randomization  = 1000;
cfg.correctm           = ‘cluster’;
cfg.correctail           = ‘prob’;
cfg.ivar                    = 1;
cfg.uvar                   = 2;
cfg.statistic              = ‘ft_statfun_depsamplesT’;
Nsub                        = 14;
cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]
cfg.design(2,1:2*Nsub)= [1:Nsub 1:Nsub];

stat = ft_timelockstatistics(cfg, cw{:}, cw1{:}) % cw and cw1 are cells containing my files

When I run this, i obtain 52 positive clusters and 100 negative clusters, of which 6 negative clusters are significant. 

However, I have realised that this assumed that each channel is an independant cluster? These 6 ‘clusters’ are very close to each other when plotted using ft_clusterplot,
so I thought that actually this should be 1 big cluster rather than 6 independant clusters very close to each other.

So I therefore added 

cfg.minnbchan = 2;

However, when I do this, it says there are 0 clusters generated at all.
This occurs no matter how large I make cfg.neighbourdist (even when I make it so that each magnetometer is neighbours with every other neighbour, I still get no clusters forming).

I was wondering if anyone had any thoughts, or could help me with this?
I am still new to FieldTrip so any help would be very much appreciated. I hope that I’ve included all the relevant information above required. 

All the best,
Danyal Akarca
MPhil Neuroscience, Cambridge University
MRC Cognition and Brain Sciences Unit 

More information about the fieldtrip mailing list