Dear Maaly,
Your understanding of the difference between spm_summarise and the
Volume of Interest batch module is accurate. See the code in spm_regions.m.
If you want to extract the average time series across all ROI masks, you
can compute their union with ImCalc and call spm_summarise once.
Otherwise, yes, call spm_summarise in a loop over masks. If you have an
atlas image (each ROI encoded with a different value) you can use
something like this:
% Input data
V = spm_vol(spm_select(Inf,'image'));
% Atlas (can be a NIfTI atlas filename)
xA = spm_atlas('load','Neuromorphometrics');
% Extracted data
D = zeros(numel(V),numel(xA.labels));
for i=1:numel(xA.labels)
M = spm_atlas('mask',xA,xA.labels(i).name);
D(:,i) = spm_summarise(V,struct('def','mask','spec',M),@mean);
end
Best regards,
Guillaume.
On 02/08/17 16:08, Maaly Nassar wrote:
> Dear All
>
> Is there a way to extract adjusted VOI time series using spm_summarise?
>
> I tried to compare the time courses extracted using VOI batch (spm -> Util -> Volume of interest) and spm_summarise(SPM.xY.VY,struct('def','sphere', 'spec',8, 'xyz',XYZ)) and they don't match. My guess is that VOI batch include removing confounds (whitening, drifts removal) and scaling, while summarise works on raw Y.
>
> Also, on using anatomical ROIs masks with spm_summarise, is there a way to include all masks files in spm_summarise instead of looping through each mask.
>
> Thanks,
> Maaly
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|