Dear Guillaume
I wrote the residuals while estimating GLM using
matlabbatch{2}.spm.stats.fmri_est.write_residuals = 1;
then I looped through the Res_xxxx.nii files (resFiles) for each subject using
for s = 1:length(subjDirs)
resFiles = cellstr(spm_select('FPList',fullfile(mainDir,subjDirs{s},'GLM_fMRI'),'^Res\_[0-9]+\.nii$'));
Ys = [];
for r = 1:length(resFiles)
V = spm_vol(resFiles{r});
[Y] = spm_get_data(V,XYZs');
Ys = [Ys;Y];
end
end
I considered Y in each Res_xxxx file the residual of xxxx volume, is that correct? I had only 3 XYZs that have residuals and the rest are zeros. I'm not familiar with extracting data from .nii, maybe I misinterpret Y?
Also, is there a way to get the residuals in seconds rather than volumes?
Thank you for your reply
Maaly
|