[FieldTrip] Extract MNI coordinates of significant sources

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Wed Sep 9 16:44:50 CEST 2020


Hi Kathryn,

We have a faq about this on our website: http://www.fieldtriptoolbox.org/faq/homogenous/

Best wishes,
Jan-Mathijs

On 7 Sep 2020, at 20:47, Kathryn Bennett <k.bennett at bristol.ac.uk<mailto:k.bennett at bristol.ac.uk>> wrote:

Dear List,

I have run group-level source statistics on my data and extracted the labels of regions showing statistically significant differences at a group-level. I now wish to extract the average mni coordinates for these regions, but do not how to transform voxel coordinates to mni coordinates. I would be grateful if anyone could help with this?

I have pasted my code below.

Many thanks in advance,
Kathryn

%% run source statistics - compare average source coherence for exp vs control
cd D:\DICsModel
atlas = ft_read_atlas('ROI_MNI_V4.nii'); % MNI
% for TAL:
%afni = ft_read_atlas('C:\Users\Kat\Documents\NPMK\fieldtrip-20200607\template\atlas\afni\TTatlas+tlrc.HEAD');
cfg = [];
cfg.dim         = AllExp{1}.dim;
cfg.method      = 'montecarlo';
cfg.parameter = 'avg.coh';
cfg.statistic   = 'ft_statfun_depsamplesT';
cfg.correctm    = 'cluster';
cfg.computecritval = 'yes';
cfg.computeprob    = 'yes';
cfg.numrandomization = 50000;
cfg.tail        = 0; % one-tailed right sided rather than 2 tailed, 0=two-sided
nsubj=numel(AllExp);
cfg.design(1,:) = [1:nsubj 1:nsubj];
cfg.design(2,:) = [ones(1,nsubj)*1 ones(1,nsubj)*2];
cfg.uvar        = 1; % row of design matrix that contains unit variable (in this case: subjects)
cfg.ivar        = 2; % row of design matrix that contains independent variable (the conditions)
stat = ft_sourcestatistics(cfg, AllExp{:},AllCntrl{:});
% stat.prob with the p values for each grid point
% stat.mask with a 1 for each grid point if it is significant and a 0 if it is not significant
% stat.posclusters and stat.negclusters you will find for each cluster the p and cluster-t values
% cirange = confidence interval of p-value
% stddev = st. dev of the p-value
%% interpolate the t maps to the structural MRI of the subject %
cfg = [];
cfg.parameter = 'all';
statplot  = ft_sourceinterpolate(cfg, stat, template_mri);
% plot the t values on the MRI %
cfg = [];
cfg.method        = 'ortho';
cfg.location = 'max';
%cfg.method        = 'slice';
cfg.funparameter  = 'stat';
cfg.funcolormap  = 'jet';
cfg.atlas         = atlas;
cfg.maskparameter = 'mask'; % only show significant regions
cfg.colormap   = 'jet';
cfg.colorbartext  = '\fontsize{16}t-statistic';
cfg.axisfontsize = 16;
ft_sourceplot(cfg, statplot);
%% list identified brain regions
statplot.mask = ((statplot.mask >0));
cfg=[];
cfg.atlas = atlas;
cfg.maskparameter = 'mask';
labels = ft_volumelookup(cfg,statplot);
%%
n=1;
for i = 1:size(labels.name,1)
    if labels.count(i) >0
        labels.unique(n,1) = labels.name(i);
        labels.uniquecount(n,1) = labels.count(i);
        n=n+1;
    end
end

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

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


More information about the fieldtrip mailing list