Mean-centering data set (dual regression)


I am trying to mean-center a 4D dataset that contains the GLM parameter estimate images (if anyone is familiar, the stage 2 file output from FSL’s dual regression function) for a paired t-test pharmacology study. I am just looking for a function that mean-centers a 4D dataset, independent of running any statistical tests. I know that 3dMVM has an option for mean centering of the quantitative variables, but I don’t think this will work for me as I am not running any statistical tests. Could there be a 3dcalc or 3dmean command? Or maybe something outside of AFNI?

Any help is greatly appreciated!



Try this. First use 3dTstat to obtain the mean of all the volumes:

3dTstat -mean yourData -prefix mean

Then subtract the mean from your data:

3dcalc -a meann -b yourData -expr ‘b-a’ -prefix …