Hi Chris,
the data type of the temporary standardised residual images is defined
in spm_spm.m line 533.
If you want SPM to save all the residual images you need to edit
spm_defaults.m so that stats.maxres = Inf.
These images are then deleted (as they are only used for estimating the
smoothness) in spm_spm.m lines 912-918.
Note also that they are not the raw residuals but standardised ones (see
line 764 of spm_spm.m) as it's what spm_est_smoothness.m later expects.
However, if you just want to remove some confounds in your data, you
might be better off at writing some dedicated code that would call
x = spm_sp('Set',X);
r = spm_sp('res',x,Y);
where X is your design matrix containing the confounds, Y your time
series and r the residuals.
Using spm_spm.m to only get the residuals seems to me more of a
workaround than a feature this function should have.
Best regards,
Guillaume.
On 06/08/10 15:09, Chris Filo Gorgolewski wrote:
> Thanks all.
>
> On Fri, Aug 6, 2010 at 9:42 AM, Stephen J. Fromm<[log in to unmask]> wrote:
>> Why do you think using double instead of float is that much more time consuming? (I do understand that a naive calculation says it takes twice as much time to write/read the data.)
> The naive calculations has proven to be correct :)
>
>> If you found the place in the code to turn off the deletion of the residuals, maybe you could find the place in the code where SPM uses double and change it to float?
> I ended up converting to float32 using fslmath. I prefer to change SPM
> code as little as possible (because it is hard to maintain your own
> version).
>
> BTW - can I make a feature request? Could saving residuals be an
> option I could set somewhere? This way I would not have to patch my
> SPM version each time there is a new release.
>
> Thanks!
> Chris
>
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|