SPM Write Residuals

Hi everyone,

I want to do some data analysis on the residuals from a model estimation in SPM. However, I have noticed that SPM did not return one residual image per original functional volume but that quite some residuals seem to be missing after model estimation. Does anyone know why this might be the case?

Thanks in advance!
Jasmin

This seems related to this topic.

Thanks, but I know how to make SPM write and keep the residuals; the problem here is that, say my functional run has 600 images, but I am only getting 500 residual images as output from SPM. The missing ones seem pretty randomly distributed amongst the 600 volumes. I wonder why that is?

This is strange. Any luck asking on the SPM mailing list?

Hi @JasminStein,

How are you saving the residual images? Are you using the write_residuals option during model estimation as suggested by @Remi-Gau or are you looking at the temporary ResI_????.nii files? With the latter, only a subset of them are saved (64 by default), uniformly sampled over repetitions (time here):

If you are using the former (or directly calling spm_write_residuals), it would be useful to have more details as this would be a bug.