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

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Tue Oct 8 08:38:33 CEST 2013


Dear Roey and Aia,

This indeed was our bad. We have fixed it in the current version of FieldTrip.
The version will be available for download tonight (CET), but you can get an instantaneous update of the code repository by doing 'ft_version update' on the Matlab command line.
This will update the fieldtrip copy you are using to the latest version. Note that if you want to keep a 'static' version, you need to back up the version with a fixed date, because all changes will be incorporated.

A little note to the following piece of code:

> % 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'];

The same can be achieved with the fullfile function (which deals with platform specific file-separators automatically):

templateDir=which('ft_defaults');
cfg.atlas = fullfile(templateDir,template,atlas,ROI_MNI_V4.nii');


Best,
Jan-Mathijs



On Oct 8, 2013, at 8:25 AM, Roey Schurr wrote:

> Hello again,
> 
> Sorry, it seems like the older version (with ft_volumelookup) is just our mistake.
> However the problem is still relevant, for the function volumelookup is still undefinded in our case.
> 
> Hopefully someone might know what we did wrong.
> 
> Thank you once again!
> Aia and Roey
> 
> 
> On Tue, Oct 8, 2013 at 12:54 AM, Roey Schurr <roeysc at gmail.com> wrote:
> 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);
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793

http://www.hettaligebrein.nl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131008/cbdad828/attachment-0002.html>


More information about the fieldtrip mailing list