Filter data and nuisance variables before regression

Good day!

I would like to bandpass filter my resting state data and nuisance regressors before performing regression as described in Hallquist et al (Neuroimage, 2013). Am I implementing it in AFNI correctly (code below)?

Are my inputs to the 3dDeconvolve -ortvec options (here, white matter and csf time series) correct? Within 3dbandpass, I do filter the regressor time series with the -ort option but what I eventually put into the regression (-ortvec) are my unfiltered regressors.

Thank you very much!


resting state data - rest.nii.gz
white matter regressor time series - wm.1D
csf regressor time series - csf.1D
censor file - fdanddvars.1D


bandpass filter EPI and regressors

3dBandpass -nodetrend -mask brainmask.nii.gz
-ort wm.1D -ort csf.1D
-prefix rest.bpass.nii.gz 0.009 0.08 rest.nii.gz

create regression matrix

${afnipath}/3dDeconvolve -input rest.bpass.nii.gz
-mask brainmask.nii.gz
-censor fdanddvars.1D
-ortvec wm.1D ROI.WMe \
-ortvec csf.1D ROI.CSFe \
-polort 3 -float \
-jobs 8 \
-fout -tout -x1D X.xmat.1D -xjpeg X.jpg \
-x1D_uncensored X.nocensor.xmat.1D \
-fitts fitts.$subj \
-errts finaldata.nii.gz \
-x1D_stop \
-bucket stats.$subj \

perform regression

3dTproject -polort 0 -input rest.bpass.nii.gz
-censor fdanddvars.1D -cenmode ZERO
-ort X.nocensor.xmat.1D -prefix finaldata.nii.gz


Exactly how do you want to process the data? Since
the steps are not simultaneous, perhaps the goal is
to bandpass regressors of no interest with the data,
except that both -polort 3 and censoring are only
applied in 3dDeconvolve. It is difficult to separate
censoring from the regression.

If you want to put all of this together, I suggest
using Example 11 from the help, maybe
with an additional -regress_bandpass option.

  • rick