[FieldTrip] Help with ft_sourcestatistics input

Tao Wang wangtao0331 at tju.edu.cn
Thu Jul 23 17:16:34 CEST 2020


Dear community,

 

My name is Tao Wang and I study at Tianjin University. My research direction
is to explore ways(tDCS\tACS) to improve working memory. I’m looking to
perform a cluster-based permutation test on my source data(the result from
ft_sourceanalysis).

 

I carefully read the function help and the
tutorial(http://www.fieldtriptoolbox.org/example/source_statistics/).
However, I receive the following error message:

 

Error using spm_bwlabel

spm_bwlabel: CONN must be 6, 18 or 26

Error in clusterstat (line 191)

      [posclusobs, posnum] = spm_bwlabel(tmp, 2*numdims);

Error in ft_statistics_montecarlo (line 353)

  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ft_sourcestatistics (line 202)

  [stat, cfg] = statmethod(cfg, dat, design);

 

I am running the following: 

cfg=[];

cfg.parameter='pow';

cfg.method='montecarlo';

cfg.statistic = 'ft_statfun_depsamplesT';

cfg.correctm = 'cluster';

cfg.clusteralpha = 0.05;

cfg.clusterstatistic = 'maxsum';

cfg.tail=0;

cfg.clustertail=0;

cfg.alpha=0.025;

cfg.numrandomization = 1000;

nsubj = 10;

cfg.design(1,:) = [1:nsubj 1:nsubj];

cfg.design(2,:) = [ones(1,nsubj)*1 ones(1,nsubj)*2];

cfg.uvar        = 1; % row of design matrix that contains unit variable (in
this case: subjects)

cfg.ivar        = 2; % row of design matrix that contains independent
variable (the conditions)

 

stat = ft_sourcestatistics(cfg, grandavgA{:}, grandavgB{:});

 

My data:

display (grandavgA{1})

time: [1×400 double]

inside: [8196×1 logical]

pos: [8196×3 double]

tri: [16384×3 double]

method: 'average'

avg: [1×1 struct]

cfg: [1×1 struct]

display(grandavgA{1}.avg)

  mom: {1×8196 cell}

  pow: [8196×1 double] %I used ‘8196×1 double’ instead of ‘8196×400 double’

  noisecov: {1×8196 cell}

 

Do I need to set cfg.neighbours, like the settings in the tutorial
"Cluster-based permutation tests on event related fields"? (I noticed
cfg.dim, but it doesn’t appear in my source struct)

Can someone tell me if there is something wrong with the cfg settings I use
or if I am doing something wrong at any other place? Any tips anyone has
would be very much appreciated!

Hope that helps!

    

    Best,

    Tao

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200723/064ca7cd/attachment.htm>


More information about the fieldtrip mailing list