[FieldTrip] Using Atlas ROIs in EEG Source Statistics (ft_sourcestatistics)

Roey Schurr roeysc at gmail.com
Mon Oct 7 23:54:40 CEST 2013


Hello all,

We are having some problems defining atlas-based ROIs using
ft_sourcestatistics on two source structures obtained via ft_sourceanalysis
(whose grid is later changed according to a precalculated MNI-warped grid).

It seems like the function "statistics_wrapper" has changed between
"fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls
"volumelookup" and not "ft_volumelookup", so we get the following error:

      ??? Undefined function or method 'volumelookup' for input
      arguments of type 'struct'.

      Error in ==> statistics_wrapper at 136
              tmp = volumelookup(tmpcfg, varargin{1});

Using the older fieldtrip vesion we get this error:
    ??? Subscript indices must either be real positive integers or
    logicals.

      Error in ==> statistics_wrapper at 213
            tmp(i,:) = mean(dat(roi,:), 1);

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

So it seems like we didn't define the ROIs correctly, however we are not
sure why.

Any suggestions would be greatly appreciated!
The relevant pieceof code is attached.

Thank you all,
Aia and Roey



Relevant code
============
% Convert sources units to mm, to fit the atlas's units
sourceCondition1 = ft_convert_units(sourceCondition1, 'mm');
sourceCondition2 = ft_convert_units(sourceCondition2, '
design = [ ones(1,length(sourceCondition1.trial)),
2*ones(1,length(sourceCondition2.trial)) ];

cfg = [];
cfg.dim = sourceCondition1.dim;
cfg.method = 'montecarlo';
cfg.statistic = 'indepsamplesT';
cfg.parameter = 'pow';
cfg.correctm = 'cluster';
cfg.numrandomization = 1000;
cfg.alpha = 0.01;
cfg.tail = 0;
cfg.design(1,:) = design;
cfg.ivar = 1;

% Load the Atlas
templateDir = which('ft_defaults'); % use a known function (ft_defaults) to
find FieldTrip's directory
backslashIndices = find(templateDir=='\');
templateDir(backslashIndices(end)+1:end) = [];      clear backslashIndices;
cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii'];


cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs:
"Precentral_L", "Precentral_R", etc/

cfg.avgoverroi   = 'yes';
cfg.hemisphere   = 'both';
cfg.inputcoord   = 'mni';

stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131008/3b7be871/attachment-0001.html>


More information about the fieldtrip mailing list