<div dir="ltr">Hi all,<div><br></div><div>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.</div>
<div><br></div><div>I have two freq cell structures corresponding to 2 conditions, 10 subjects each (within-subject design).</div><div><br></div><div>I know the layout, template and neighbour approach for Neuromag is tricky because of the different sensor types, but here's what I did:</div>
<div><br></div><div><div>cfg = [];</div><div><br></div><div>cfg_lay.layout = 'neuromag306cmb.lay';</div><div>cfg_lay.grad = freq{1}.grad;</div><div><br></div><div>cfg_neighb.layout = ft_prepare_layout(cfg_lay,freq{1});</div>
<div>cfg_neighb.method   = 'template';</div><div>cfg_neighb.template = 'neuromag306cmb_neighb.mat';</div><div><br></div><div>cfg.neighbours       = ft_prepare_neighbours(cfg_neighb,freq{1});</div><div><div>
cfg.minnbchan        = 2;</div></div><div><br></div><div>... And then the cfg continues with standard settings for cluster-based permutation testing.</div><div><br></div><div>When I run:</div><div><div>stat = ft_freqstatistics(cfg, freq{2}, freq{1});</div>
</div><div><br></div><div>I get the error:</div><div><br></div><div><div>??? Error using ==> findcluster at 56</div><div>invalid dimension of spatdimneighbstructmat</div><div><br></div><div>Error in ==> clusterstat at 185</div>
<div>      posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);</div><div><br></div><div>Error in ==> ft_statistics_montecarlo at 361</div><div>  [stat, cfg] = clusterstat(cfg, statrand, statobs);</div>
<div><br></div><div>Error in ==> ft_freqstatistics at 323</div><div>  [stat, cfg] = statmethod(cfg, dat, cfg.design);</div></div><div><br></div><div>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 error. </div>
<div>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:</div><div><br></div><div><br></div><div><img src="cid:ii_14401ef2741c3492" alt="Inline image 1" width="200" height="188"><br>
</div><div><img src="cid:ii_14401f0417bfe235" alt="Inline image 2" width="177" height="200"><br></div><div><br></div><div>Does anybody have a suggestion how to tackle this problem?</div><div>Any help is much appreciated!</div>
<div><br></div><div>Thanks,</div><div>Joram</div><div><br></div><div><br></div><div><br></div>-- <br><div dir="ltr">Joram van Driel, MSc.<div>PhD student @ University of Amsterdam</div><div>Brain & Cognition @ Department of Psychology</div>
</div>
</div></div>