Hello AFNI gurus,
I have a few datasets that I am doing non-GLM analyses on, which means that I would like to detrend the data, like so:
3dDetrend -prefix ${INPUTFILE}.vr.dt.nii.gz -polort 2 \
-vector motparam.${INPUTFILE}.1D ${INPUTFILE}.vr.nii.gz
The detrending works great, but I run into problems with the next step, when I try to scale the data to AFNIPROC-style, to convert values to percent-signal change like so:
3dcopy ${INPUTFILE}${SUFFIX} temp_run+orig
3dTstat -prefix temp_mean+orig temp_run+orig
3dcalc -float -a temp_run+orig -b temp_mean+orig \
-expr 'min(200, a/b*100)*step(a)*step(b)' \
-prefix ${INPUTFILE}.sc.nii.gz
After the detrending I have negative values in my datasets, which I think is to be expected, but it also means that the scaling code produces a dataset that is nothing but zeros and 200's. What is the appropriate way of scaling a detrended dataset?
I am sure this is pretty simple, but I just want to make sure I am doing things the right way.
Thanks,
Peter