sourcestatistics: another bug/problem

Hoi Fei Kwok h.f.kwok at BHAM.AC.UK
Mon Sep 26 16:09:28 CEST 2005

Dear Robert,

Thanks. I have changed line 65 of the statistic_wrapper.m but encountered
the following error:

??? Reference to non-existent field 'design'.

Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98
  design =;

Error in ==> sourcestatistics at 86
  stat = statistics_wrapper(cfg, varargin{:});

The problem seems to arise from the fact that while calling the
source_statistics, 'design' is not one of the fields that one has to

Hoi Fei

-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Robert Oostenveld
Sent: 26 September 2005 14:33
Subject: Re: [FIELDTRIP] sourcestatistics

Hi Ho Fei

On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote:
> We've been trying to use sourcestatistics.m but I found that first
> of all a
> few private functions are missing. These include:
> sourcestatistics_parametric.m
> sourcestatistics_randomization.m
> and sourcestatistics_randcluster.m

There are different methods available for statistical assesements of
differences between conditions, most of them are implemented for all
different data types, namely ERPs TFRs and source reconstructions.
These are implemented as submethods of the sourcestatistics,
freqstatistics and timelockstatistics functions. These functions will
call the appropritate subfunction, and these are missing. Some of the
subfunctions are still work in progress and are not part of the
release version of fieldtrip (because of scientific novelty).
However, there are also a few subfunctions that are supposed to be
part of the release version. I just checked and they are indeed not
part of the current zip file any more. I will make sure to include
them in the upcoming daily version. Furthermore, I will also send
them to you as attachement in a separate mail (probably tomorrow).

> Another problem occurred when we tried to set the cfg.approach to
> 'stat':
> ...
> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65
>     if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length
> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos))

That is indeed a bug. Please change the last part of the statement
from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos
(:)==varargin{1}.pos(:))". I will fix it in the official version as

best regards,

PS Sorry for my late reply, I was on the SPR conference.

More information about the fieldtrip mailing list