Hi Adam,
Daniel Glen reminded me that your point is to do the detrending
on a concatenation of runs, for which 3dDetrend is not equipt.
That leaves the choices of detrending the runs individually for
3dDetrend, or using 3dDeconvolve to do the detrending.
Since it is clear how to break the runs up for 3dDetrend, let me
just mention using 3dDeconvolve. To do that, set the AFNI_1D_TIME
variable, use the same 3dmaskave command for 3dDetrend, and apply
the same 3dDeconvolve command, but using your 3dmaskave output.
i.e.
setenv AFNI_1D_TIME Y
echo `3dmaskave -mask Subj_ROIs+orig -mrange 1 1 -quiet \
Subjallruns+orig` > Subj_ROIave.1D
3dDeconvolve -mask Subj_ROIs+orig -input Subj_ROIave.1D \
-fdisp 123456 -concat cat1.txt -polort 2 -num_stimts 0 \
-errts Subj_ROIave_detrend
Also, the Subj_ROIave_detrend output of 3dDeconvolve will have no
header information that you would otherwise need to strip off.
- rick