error in timelockstatistics

Bernhard Staresina bps231 at NYU.EDU
Wed Nov 7 01:18:35 CET 2007


Dear Fieldtrip experts,

I have a brief question about “timelockstatistics”. Using only data from one
electrode (i.e., I compute temporal, not spatial clusters for my stats), I
get the following error message when I run the analysis:


==========

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

Error in ==> fieldtrip-0.9.8/private/clusterstat at 125
    tmp(cfg.inside) = postailobs;

Error in ==> statistics_montecarlo at 319
  stat = clusterstat(cfg, statrand, statobs);

Error in ==> fieldtrip-0.9.8/private/statistics_wrapper at 245
  [stat, cfg] = statmethod(cfg, dat, cfg.design);

Error in ==> timelockstatistics at 102
[stat] = statistics_wrapper(cfg, varargin{:});

==========

When I follow the error messages, it turns out that changing the lines 30-37
in clusterstat.m from 

==========
if isfield(cfg, 'neighbours') && ~isempty(cfg.neighbours)
  channeighbstructmat = makechanneighbstructmat(cfg);
  issource = 0;
else
  issource = 1;
  % cfg contains dim and inside that are needed for reshaping the data to a
volume, and inside should behave as a index vector
  cfg = fixinside(cfg, 'index');
end
==========

to

==========
% if isfield(cfg, 'neighbours') && ~isempty(cfg.neighbours)
  channeighbstructmat = makechanneighbstructmat(cfg);
  issource = 0;
% else
%   issource = 1;
%   % cfg contains dim and inside that are needed for reshaping the data to
a volume, and inside should behave as a index vector
%   cfg = fixinside(cfg, 'index');
% end
==========

seems to solve the problem – at least I get reasonable results without an
error message. I’d rather not change the code, however, so if you could
point me to any possible reason for this I’d be very grateful.

Thanks in advance,
Bernhard


PS: Here are the configuration settings that produced the error before
modifying the code:

cfg = [];
cfg.method = 'montecarlo';
cfg.statistic = 'indepsamplesT';
cfg.clusteralpha = 0.1;
cfg.clusterstatistic = 'maxsum';
cfg.clustertail = 0;
cfg.minnbchan = 0;
cfg.ivar  = 1;
cfg.numrandomization = 100;
 
design = zeros(1,size(cond1.trial,1)+size(cond2.trial,1));
design(1,1:size(cond1.trial,1)) = 1;
design(1,(size(cond1.trial,1)+1:(size(cond1.trial,1)+size(cond2.trial,1)))) = 2;
cfg.design = design;
 
cfg.neighbours={};
 
cfg.channel = {'MT2'};
cfg.latency = [-0.3 1.0]; 
 
[stat] = timelockstatistics(cfg, cond1, cond2)

----------------------------------
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 http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.



More information about the fieldtrip mailing list