Hello All,
I am trying to manually calculate the residuals and compare them
with the values in the ResI.img image files to ensure that I am using
the correct image values for some calculations I am doing.
My approach is this:
To find the estimated image values using the design matrix (Yest):
I take the design matrix in SPM.xX.X and multiply it by the beta
values (put in a matrix) that are retrieved from the beta_**.img files.
To find the actual image values (those that are measured during the
fMRI scan) that are compared with the estimated values (Yest) to find
the residuals: I retrieve the image values from the images that are
already preprocessed and put into SPM5 for a 1st level analysis and
multiply them by the global scaling factor SPM.xGX.gSF(1).
I then subtract Yactual - Yest to get the residuals.
Unfortunately, the residuals I calculate do not match the residuals
in the ResI.img files. Does anyone know what I am missing? I am not
using a custom W matrix and I am aware that the values in both Yactual
and Yest need DCT filtering but this will not solve the problem.
Suggestions?
Thank you.
Todd Penney
|