<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Malgorzata,<div><br></div><div>from a quick glance, it appears that in the call to spm_bwlabel "numdims" should be 3 to give you 2*numdims = 6.</div><div>So, could you check what numdims is in your case?</div><div>I suspect that you have 4-dimensional data (time by 3 spatial dimensions), so it might help to check where the dimensions are coming from and what happens if you average over time.</div><div><br></div><div>Good luck,</div><div><br></div><div>Julian</div><div><br><div><div>Am 24.05.2017 um 16:34 schrieb Malgorzata Wislowska:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Dear FT-community,<div><br></div><div><br></div><div>when calculating cluster permutation statistics on the source level, I receive the following error:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font color="#ff0000">Error using spm_bwlabel</font></div></div><div><div><font color="#ff0000">spm_bwlabel: CONN must be 6, 18 or 26</font></div></div><div><div><font color="#ff0000"><br></font></div></div><div><div><font color="#ff0000">Error in clusterstat (line 319)</font></div></div><div><div><font color="#ff0000"> [negclusrnd, negrndnum] = spm_bwlabel(tmp, 2*numdims); % use spm_bwlabel for 2D/3D to avoid usage of image toolbox</font></div></div><div><div><font color="#ff0000"><br></font></div></div><div><div><font color="#ff0000">Error in ft_statistics_montecarlo (line 347)</font></div></div><div><div><font color="#ff0000"> [stat, cfg] = clusterstat(cfg, statrand, statobs);</font></div></div><div><div><font color="#ff0000"><br></font></div></div><div><div><font color="#ff0000">Error in ft_sourcestatistics (line 218)</font></div></div><div><div><font color="#ff0000"> [stat, cfg] = statmethod(cfg, dat, design);</font></div></div></blockquote><div><br></div><div>I used MNE method for the inverse problem. I have 8196 grid points 1555 time points.</div><div>But the error occurs also when I average across the time.</div><div><br></div><div>Here is my configuration structure for the source analysis:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font color="#0000ff"><br></font></div><div><div><font color="#0000ff">design = zeros(2, nb_of_sbj*2);</font></div></div><div><div><font color="#0000ff">design(1,:) <span class="gmail-Apple-tab-span" style="white-space:pre"> </span>= [1:nb_of_sbj 1:nb_of_sbj];</font></div></div><div><div><font color="#0000ff">design(2,:) <span class="gmail-Apple-tab-span" style="white-space:pre"> </span>= [ones(1,nb_of_sbj) ones(1,nb_of_sbj)*2];</font></div></div><div><div><font color="#0000ff"><br></font></div></div><div><div><font color="#0000ff">cfg = [];</font></div></div><div><div><font color="#0000ff">cfg.method = 'montecarlo';</font></div></div><div><div><font color="#0000ff">cfg.statistic = 'ft_statfun_depsamplesT';</font></div></div><div><div><font color="#0000ff">cfg.parameter = 'pow';</font></div></div><div><div><font color="#0000ff">cfg.correctm = 'cluster';</font></div></div><div><div><font color="#0000ff">cfg.clusterstatistic = 'maxsum';</font></div></div><div><div><font color="#0000ff">cfg.design = design;</font></div></div><div><div><font color="#0000ff">cfg.ivar = 2;</font></div></div><div><div><font color="#0000ff">cfg.uvar = 1;</font></div></div><div><div><font color="#0000ff">cfg.numrandomization = 5000;</font></div></div><div><div><font color="#0000ff">cfg.tail = 0;</font></div></div><div><div><font color="#0000ff">cfg.alpha = 0.025;</font></div></div><div><div><font color="#0000ff"><br></font></div></div><div><div><font color="#0000ff">[stat] = ft_sourcestatistics(cfg,avg_con_sel{:},avg_incon_sel{:});</font></div></div></blockquote><br><div>As far as I can see somebody had asked the same question last year, but the post doesn't seem to have been addressed:<br><a href="https://mailman.science.ru.nl/pipermail/fieldtrip/2016-August/010762.html">https://mailman.science.ru.nl/pipermail/fieldtrip/2016-August/010762.html</a><br></div><div><br></div><div><br></div><div>Thank you for your help in advance.</div><div><br></div><div>Best regards,</div><div>Malgorzata Wislowska,</div><div>University of Salzburg</div></div>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br></div></body></html>