<div dir="ltr">Dear all,<br><br>I'm trying to run a cluster-level permutation test with an old script in which I used the neighbourhood map of a Biosemi cap. The only thing I have changed there is the neighbourhood that is now for a GSN-HydroCel-129 one, so I just re wrote the neighbours for each channel the same way I did for the Biosemi one. I use an old version of Fieldtrip here which was working fine, but even with the newest versions and modifications, it doesn't work. What do you think I could be doing wrong? <div>
<br></div><div>Thank you!!<div><br></div><div><br></div><div><b>This is the output I get:</b><br><br>Selecting and formatting the data.<br>selected 128 channels<br>selected 1000 time bins<br>selected 1 frequency bins<br>Calculating the neighbourhood structure of the channels.<br>
Running the statistics engine.<br>Statistic-specific preprocessing (calculating critical values, initializing draws from the randomization distribution, ...).<br>randomization 0 1000<br>Undefined function 'bwlabeln' for input arguments of type 'double'.<br>
<br>Error in findcluster (line 73)<br>  [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4);<br><br>Error in clusterrandstatistics (line 851)<br>            [posclusterslabelmat,nposclusters] = findcluster(onoff,data.channeighbstructmat,cfg.minnbchan);<br>
<br>Error in clusterrandanalysis (line 462)<br>[clusrand] = clusterrandstatistics(cfg, data);<br><br>Error in clusterrand_stats_ERP_CW (line 347)<br>  [clusrand] = clusterrandanalysis(cfg,GavgI,GavgC);<br></div><div><br></div>
<div><br></div><div><b>And this is my script</b></div><div><br></div><div><div>function [clusrand] = clusterrand_stats_ERP_WC()</div><div>S = load('4WC_1.avg','-MAT');</div><div>avgC41 = S.avgC;</div><div>
avgI41 = S.avgI;</div><div><br></div><div>S = load('4WC_2.avg','-MAT');</div><div>avgC42 = S.avgC;</div><div>avgI42 = S.avgI;</div><div><br></div><div>etc...</div><div><br></div><div><br></div><div>cfg =[];</div>
<div>cfg.keepindividual = 'yes';</div><div><br></div><div>GavgC = timelockgrandaverage(cfg,avgC41,avgC42,.....);</div><div>GavgI = timelockgrandaverage(cfg,avgI41,avgI42.....);</div><div><br></div><div>save('grand_averages','GavgC','GavgI');</div>
<div><br></div><div>  cfg.latency = [0 1];</div><div>  cfg.channel = {'all'};</div><div>  cfg.avgovertime = 'no';</div><div>  </div><div>  cfg.statistic = 'depsamplesT';</div><div>  cfg.alpha = 0.05;</div>
<div>  cfg.clusterteststat = 'maxsum';</div><div>  </div><div>  cfg.makeclusters = 'yes';</div><div>  cfg.alphathresh = 0.05;</div><div>  cfg.minnbchan    = 0;</div><div><br></div><div>  cfg.elecfile = 'GSN-HydroCel-129.sfp';</div>
<div>  </div><div>  cfg.neighbours{1}.label = 'E1';</div><div>  cfg.neighbours{1}.neighblabel = {'E125', 'E8', 'E2', 'E122','E121'};</div><div>  cfg.neighbours{2}.label = 'E2';</div>
<div>  cfg.neighbours{2}.neighblabel = {'E1', 'E8', 'E14', 'E9','E3','E123','122'};</div><div>  cfg.neighbours{3}.label = 'E3';</div><div>  cfg.neighbours{3}.neighblabel = {'E2', 'E123', 'E124','E4','E10','E9'};</div>
<div>  </div><div>etc...</div><div>    </div><div><br></div><div> cfg.nranddraws = 1000;</div><div><br></div><div> [clusrand] = clusterrandanalysis(cfg,GavgI,GavgC);</div><div><br></div><div>save clusrand_WC clusrand;</div>
<div><br></div><div>end</div></div></div></div>