[FieldTrip] Cluster-level permutation test problem

Ana Laura Diez Martini diezmartini at gmail.com
Fri Jun 6 04:43:14 CEST 2014

Dear all,

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?

Thank you!!

*This is the output I get:*

Selecting and formatting the data.
selected 128 channels
selected 1000 time bins
selected 1 frequency bins
Calculating the neighbourhood structure of the channels.
Running the statistics engine.
Statistic-specific preprocessing (calculating critical values, initializing
draws from the randomization distribution, ...).
randomization 0 1000
Undefined function 'bwlabeln' for input arguments of type 'double'.

Error in findcluster (line 73)
  [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :,
:), nfreq, ntime), 4);

Error in clusterrandstatistics (line 851)
            [posclusterslabelmat,nposclusters] =

Error in clusterrandanalysis (line 462)
[clusrand] = clusterrandstatistics(cfg, data);

Error in clusterrand_stats_ERP_CW (line 347)
  [clusrand] = clusterrandanalysis(cfg,GavgI,GavgC);

*And this is my script*

function [clusrand] = clusterrand_stats_ERP_WC()
S = load('4WC_1.avg','-MAT');
avgC41 = S.avgC;
avgI41 = S.avgI;

S = load('4WC_2.avg','-MAT');
avgC42 = S.avgC;
avgI42 = S.avgI;


cfg =[];
cfg.keepindividual = 'yes';

GavgC = timelockgrandaverage(cfg,avgC41,avgC42,.....);
GavgI = timelockgrandaverage(cfg,avgI41,avgI42.....);


  cfg.latency = [0 1];
  cfg.channel = {'all'};
  cfg.avgovertime = 'no';

  cfg.statistic = 'depsamplesT';
  cfg.alpha = 0.05;
  cfg.clusterteststat = 'maxsum';

  cfg.makeclusters = 'yes';
  cfg.alphathresh = 0.05;
  cfg.minnbchan    = 0;

  cfg.elecfile = 'GSN-HydroCel-129.sfp';

  cfg.neighbours{1}.label = 'E1';
  cfg.neighbours{1}.neighblabel = {'E125', 'E8', 'E2', 'E122','E121'};
  cfg.neighbours{2}.label = 'E2';
  cfg.neighbours{2}.neighblabel = {'E1', 'E8', 'E14',
  cfg.neighbours{3}.label = 'E3';
  cfg.neighbours{3}.neighblabel = {'E2', 'E123', 'E124','E4','E10','E9'};


 cfg.nranddraws = 1000;

 [clusrand] = clusterrandanalysis(cfg,GavgI,GavgC);

save clusrand_WC clusrand;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140606/ea3f3d11/attachment-0001.html>

More information about the fieldtrip mailing list