[FieldTrip] ROI-based source analysis with ft_sourcestatistics

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Fri Aug 26 10:16:09 CEST 2022

Hi Giuseppe,

If you open ft_sourcestatistics and read the help documentation, it states:

% FIXME the following needs to be reimplemented
% You can restrict the statistical analysis to regions of interest (ROIs)
% or to the average value inside ROIs using the following options:
%   cfg.atlas        = filename of the atlas
%   cfg.roi          = string or cell of strings, region(s) of interest from anatomical atlas
%   cfg.avgoverroi   = 'yes' or 'no' (default = 'no')
%   cfg.hemisphere   = 'left', 'right', 'both', 'combined', specifying this is required when averaging over regions

If I subsequently search the code for the term ‘roi’ or ‘avgoverroi’, I only get a hit for the occurrences in the help documention, so that means that there is no functional  consequence of specifying those options.

In other words: it is not so surprising that it doesn’t work, at least not in the way that you implemented it in your scripts. This also means that the documentation you used to create your scripts is out of sync with the code. That’s unfortunate, and it would be helpful if propose a change to the website (it could be as minimal as inserting a disclaimer or so) that flags the non-functionality of that snippet of code (for the time being).

This being said, there have been various code/workflow improvements over the past years, which in principle would make it possible for you to achieve what you want, using a different route.

This requires the use of ft_sourceparcellate (or ft_virtualchannel), followed by a call to ft_timelockstatistics/ft_freqstatistics. If the documentation online proves insufficient, then it would be helpful if you were to write a bit of documentation once you find out how to do it.

Good luck and best wishes,

On 24 Aug 2022, at 15:53, Zito Giuseppe Angelo via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear Fieldtrip community,

I would like to bring up the topic of ROI-based source analysis. I’ve seen that many have asked about this in the last years, but I could not find an answer that worked.

I would like to restrict my ft_sourcestatistics to specific ROIs taken from the aal atlas. I implemented the code as suggested in other discussions/tutorials, but the results are identical to the ones obtained without ROI selection.
Could you please give me an advice on how to solve it?

Here is my code:

realPrePost{1} =

  struct with fields:

      freq: 5.5008
       cfg: [1×1 struct]
       dim: [15 18 15]
    inside: [4050×1 logical]
       pos: [4050×3 double]
    method: 'average'
       avg: [1×1 struct]

% Prepare cfg to run the stats
cfg                  = [];
cfg.dim              = realPrePost{1}.dim;
cfg.method           = 'montecarlo';
cfg.statistic        = 'ft_statfun_indepsamplesT';
cfg.parameter        = 'pow';
cfg.correctm         = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.numrandomization = 10000;
cfg.alpha            = 0.05;
cfg.tail             = 0;

% Atlas-related cfg options
aal = ft_read_atlas('C:\toolbox\fieldtrip-20220317\template\atlas\aal\ROI_MNI_V4.nii');
cfg.atlas        = aal;
cfg.roi          = aal.tissuelabel(63:64);
cfg.avgoverroi   = 'yes';
cfg.hemisphere   = 'both'; % 'combined'

% Design matrix
designMatrix = [];
designMatrix(1,1:nReal+nSham) = [ones(1,nReal) 2*ones(1,nSham)];
cfg.design = designMatrix;
cfg.ivar = 1;
stat = ft_sourcestatistics(cfg, realPrePost{:}, shamPrePost{:});
% Load and reslice MRI template
mri = ft_read_mri('C:\toolbox\fieldtrip-20220317\template\anatomy\single_subj_T1_1mm.nii');
mri = ft_volumereslice([], mri);
cfg            = [];
cfg.downsample = 2;
cfg.parameter  = 'stat';
statPlot  = ft_sourceinterpolate(cfg, stat, mri);
% Plot source
close all
maxval = max(statPlot.stat);
cfg = [];
cfg.method        = 'ortho';
cfg.funparameter  = 'stat';
cfg.maskparameter = cfg.funparameter;
cfg.funcolorlim   = [0.5 maxval];
cfg.opacitylim    = [0.5 maxval];
cfg.opacitymap    = 'rampup';
ft_sourceplot(cfg, statPlot);

Any help would be appreciated,

Dr. Giuseppe Angelo Zito
Principal Investigator, Swiss National Science Foundation

Decision Neuroscience Lab
Department of Health Sciences and Technology (D-HEST)
ETH – Swiss Federal Institute of Technology Zurich

Winterthurerstrasse 190
8057 Zürich

Tel: +41 44 633 05 17
mailto: giuseppeangelo.zito at hest.ethz.ch<mailto:giuseppeangelo.zito at hest.ethz.ch>

fieldtrip mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220826/0e96ff13/attachment.htm>

More information about the fieldtrip mailing list