<div dir="ltr"><div>Hi there,<br><br><br></div>After beamformer sourceanalysis I end up with datastructures looking like:<br><span style="font-family:monospace,monospace"><br></span><div><span style="font-family:monospace,monospace">  struct with fields:<br><br>         freq: 10.5000<br>          cfg: [1×1 struct]<br>          pos: [2982×3 double]<br>          pow: [2982×1 double]<br>       inside: [2982×1 logical]<br>    powdimord: 'pos'<br></span><br></div><div>The .inside field is created by ft_selectdata used to average across frequencies, and contains all 1s. Running sourceanalysis with this data trows the following error:<br><br></div><div><span style="color:rgb(255,0,0)"><br></span><span style="font-family:monospace,monospace"><span style="color:rgb(255,0,0)">Error using spm_bwlabel<br>spm_bwlabel: CONN must be 6, 18 or 26</span><br><br><span style="color:rgb(255,0,0)">Error in clusterstat (line 222)<br>      [negclusobs, negnum] = spm_bwlabel(tmp, 2*numdims);<br><br>Error in ft_statistics_montecarlo (line 347)<br>  [stat, cfg] = clusterstat(cfg, statrand, statobs);<br><br>Error in ft_sourcestatistics (line 205)<br>  [stat, cfg] = statmethod(cfg, dat, design);</span><br> <br><span style="color:rgb(0,0,255)"><u>222 </u></span>      [negclusobs, negnum] = spm_bwlabel(tmp, 2*numdims);</span><br><br><br></div><div>I think this results because of a wrong estimate of the dimensionality, resulting from the fact that the data is represented in an array rather than a 3-dimensional matrix, which it seems to expect. <br><br>I think therefor that I might need to convert my data back into a 3-d representation, i..e not a sparse but full representation. I have tried using ft_source2full, but that is not straightforward as I only have inside voxels/positions. In other words, I would need to do exactly the same as ft_source_statistics seems to want to do with spm_bwlabel.<br><br></div><div>So I guess I might just have put FieldTrip on the wrong leg, to use a Dutch expression.<br><br></div><div>Any suggestions?<br><br></div><div>Best,<br></div><div>Stephen<br></div><div><br><br></div></div>