Register the mask file to the data with coregister, resampling using nearest neighbor. Load each into a data matrix in matlab (spm_vol or the nifti tools command load_nii, if you have that toolbox).
Then it is easy enough. Something like:
%get the data and reshape into a 2D matrix
ts=reshape(ts, size(ts,1)*size(ts,2)*size(ts,3), size(ts,4));
roi= reshape(roi, size(roi,1)*size(roi,2)*size(roi,3), size(roi,4));
for idx =1:maxroi(:))
And now the data from that spmfile.nii has been input. Loops through each ROI doing a correlation, or set up a parcaorr. If you want you can do an SVC instead of taking the mean. Personally I found the SVC to be a bit prone to noise, it it may have been because I had noiser high motion data.
Best of luck.,
Colin Hawco, PhD
Neuroimaging analysis and consultation
[log in to unmask]
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On Behalf Of Dennis Hernaus
Sent: April-24-17 11:06 PM
To: [log in to unmask]
Subject: [SPM] extracting time series from an ROI mask
Dear SPM community,
I would like to extract average time series from my functional data using an ROI mask containing over a 100 regions. Typically, when I extract time series, I use the eigenvariate button in SPM12 (after loading a results file). However, my understanding is that this option requires specific coordinates as input. I have tried loading the mask, but the saved results only contain time series from the MNI coordinates displayed at the bottom of the menu. Is there a straightforward way to extract many time series at once using a mask (e.g. with integer values ranging from 1-100)? Any help would be greatly appreciated.