Sebastien,
Funny, my grad student just discovered that bug too. ResMS.img
has the wrong scalefactor set, due to a bug in the spm_vol utilities
(they ignore the scalefactor in .pinfo when writing the data to
disk).
Here the skinny:
o ResMS is originally created as a residual SS image (see spm_spm.m
around line 727).
o The sum-of-squares data is scaled into a mean-squared
data with a scalefactor of 1/DF (see spm_spm.m around
line 845). Due to a bug, this scalefactor is not
written to disk in the Analyze header (it is set to 1).
o The scalefactor for ResMS is saved in VResMS.pinfo,
which is saved in the SPM structure.
The important thing is that SPM's variance estimate is OK, because
whenever ResMS is read the VResMS structure is used, which has
the correct pinfo saved. So if *you* want to read the ResMS image,
the best thing is to load SPM, and access ResMS with the VResMS
structure (clunky, I know).
Hope this helps.
-Tom
PS:
I corresponded with John, and he (justifiably) is wary of
changing the core spm_vol routines in SPM2, for fear of breaking
something. This shouldn't be problem in the NIFTI file I/O
routines which were written from scratch.
|