Error in timelockstatistics

Allen Ardestani aardesta at UCLA.EDU
Thu May 13 00:44:42 CEST 2010

Hi everyone,

I am having some difficulty using the cluster-based permutations in both
time and frequency domains.  I have just 8 channels of discrete LFP
positions, so I thought it may be problematic to cluster them together in
space.  I therefore first tried clustering only in time (ERP) or
time-frequency (ERS/ERD) by using a single channel.  I used  [stat] =
ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following

method: 'montecarlo'

statistic: 'indepsamplesT'

correctm: 'cluster'

clusteralpha: 0.0500

clusterstatistic: 'maxsum'

tail: 0

clustertail: 0

alpha: 0.0250

numrandomization: 100

design: [1x267 double]

channel: 'F1'

minnbchan: 0

layout: 'layout.mat'

ivar: 1

I get the following error message:

??? Undefined function or method 'bwlabeln' for input arguments of type

Error in ==> findcluster at 89

  [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :,
:), nfreq, ntime), 4);

Error in ==> clusterstat at 194

      posclusobs = findcluster(reshape(postailobs,

Error in ==> statistics_montecarlo at 321

  [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource);

Error in ==> statistics_wrapper at 285

    [stat, cfg] = statmethod(cfg, dat,, 'issource',issource);

Error in ==> ft_timelockstatistics at 96

[stat, cfg] = statistics_wrapper(cfg, varargin{:});

I'm assuming that part of the problem is that I don't have the Image
Processing Toolbox, but is there a way to specify to not cluster across
channels?  I'm a new user, so any advice is much appreciated.

Thanks in advance!


Allen Ardestani    Email: aardesta at

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759


The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the fieldtrip mailing list