Nonzero residuals from 3dTproject?

I’ve been using 3dTproject to run denoising with bandpassing. However, I have noticed that the voxels in the detrended outputs do not quite have a temporal mean of zero, as would be expected of residuals from a linear regression. Is this just due to the accumulation of floating-point error? Or is there something about the mathematics of this process that I am misunderstanding?

A minimal working example (given an input image “input.nii.gz”)

3dTproject -input “input.nii.gz” -prefix “detrended.nii.gz” -ort “design.tsv” -passband 0.009 0.080
3dTstat -mean -prefix “mean_detrended.nii.gz” “detrended.nii.gz”

There will certainly be truncation errors. What sorts of means are you seeing?

Also, what is the output of:

3dinfo -prefix -datum -fac mean_detrended.nii.gz

  • rick

I’m getting intensities of around 0.1 to 0.4 in the mean residual image with intensities of around 20,000 to 90,000 in the original image. Very small deviation from expectation overall, but I wanted to make sure the deviation is just error (e.g., cumulative truncation error) rather than a theoretical difference from linear regression or an issue in the algorithm.

The output for that 3dinfo call is float 0.000000.