<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi FieldTrippers,
<div><br>
</div>
<div>After doing DICS source analysis, I get an error with source statistics:</div>
<div>
<div><i>Error using spm_bwlabel</i></div>
<div><i>spm_bwlabel: CONN must be 6, 18 or 26</i></div>
<div><i><br>
</i></div>
<div><i>Error in clusterstat (line 184)</i></div>
<div><i>      [posclusobs, posnum] = spm_bwlabel(tmp, 2*numdims);</i></div>
<div><i><br>
</i></div>
<div><i>Error in ft_statistics_montecarlo (line 347)</i></div>
<div><i>  [stat, cfg] = clusterstat(cfg, statrand, statobs);</i></div>
<div><i><br>
</i></div>
<div><i>Error in ft_sourcestatistics (line 205)</i></div>
<div><i>  [stat, cfg] = statmethod(cfg, dat, design);</i></div>
<div><i><br>
</i></div>
<div><i>Error in source_analysis (line 143)</i></div>
<div><i>stat = ft_sourcestatistics(cfg, sourceAct, sourceBl);</i></div>
</div>
<div><br>
</div>
<div>I uploaded the data here (https://www.dropbox.com/s/67tocpl685ytf4e/source.mat?dl=0)<a href="https://www.dropbox.com/s/67tocpl685ytf4e/source.mat?dl=0" target="_blank" style="font-size: 10pt;">https://www.dropbox.com/s/67tocpl685ytf4e/source.mat?dl=0</a><a href="https://www.dropbox.com/s/67tocpl685ytf4e/source.mat?dl=0" target="_blank" style="font-size: 10pt;">https://www.dropbox.com/s/67tocpl685ytf4e/source.mat?dl=0</a> and
 this is the code that I am executing:</div>
<div><br>
</div>
<div>
<div><i>cfg = [];</i></div>
<div><i>cfg.method      = 'montecarlo';</i></div>
<div><i>cfg.statistic   = 'ft_statfun_depsamplesT';</i></div>
<div><i>cfg.parameter   = 'pow';</i></div>
<div><i>cfg.correctm    = 'cluster';</i></div>
<div><i>cfg.clusteralpha     = 0.05; % this is the treshold for clustering, not the</i></div>
<div><i>% statistical test of the cluster</i></div>
<div><i>cfg.clusterstatistic = 'maxsum';</i></div>
<div><i>cfg.numrandomization = 1000;</i></div>
<div><i>cfg.alpha       = 0.05; % note that this only implies single-sided testing</i></div>
<div><i>cfg.tail        = 0;</i></div>
<div><i>cfg.clustertail = 0;</i></div>
<div><i>cfg.uvar        = 1; % row of design matrix that contains unit variable (in this case: trials)</i></div>
<div><i>cfg.ivar        = 2; % row of design matrix that contains independent variable (the conditions)</i></div>
<div><i>cfg.dim = [2400 1 1];</i></div>
<div>
<div><i>design = [1:length(dataAct.trial), 1:length(dataBl.trial); ones(1,length(dataAct.trial)), ones(1,length(dataBl.trial))*2]; </i></div>
</div>
<div><span style="font-size: 10pt;"><i>cfg.design      = design;</i></span></div>
<div><span style="font-size: 10pt;"><i>stat = ft_sourcestatistics(cfg, sourceAct, sourceBl);</i></span></div>
</div>
<div><span style="font-size: 13.3333px;"><br>
</span></div>
<div><span style="font-size: 13.3333px;">Any help would be appreciated!</span></div>
<div><br>
</div>
<div><span style="font-size: 10pt;">Best,</span></div>
<div><span style="font-size: 10pt;">Mats</span></div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</body>
</html>