Dear Users,
I'm trying to do some time course analysis by hand, in order to not make
sure my SPM results actually make sense.
I loaded my raw time courses for each voxel with an external routine, which
reads directly the .nii images from my sliceTiming directory.
I loaded the beta estimates for each condition and each voxel, with an
external routine which reads directly the beta*.img images from the analysis
directory.
I loaded the design matrix, from SPM.mat in the analysis directory. It's
stored in the variable SPM.xX.X.
When I plot the raw time course for 1 voxel and the corresponding estimate,
X*Beta, they seems to match approximately but I can't get the scaling right.
I scaled the time course to a grand mean of 100 (divide by its own grand
mean and multiply by 100) then substracted 100 to have mean 0. I high pass
filtered the time course with a cutoff at 1/128Hz. There's the whitening
matrix as well, W*Y=W*X*Beta +W*e, and I found this in SPM.xX.W and used it,
but the match is still pretty bad. What else does SPM do? There's the
residual forming matrix K, which I can't really find however.
Please let me know how to match the estimated time course and the real time
course. Thank you in advance. My current plot for one voxel is attached.
- Julien
|