running only regress block with -regress_apply_mot_types demean deriv

Hello afni experts,

I have to run my afni pipeline in two steps as I want to take the data after preprocessing and run wavelet despiking on it, and bring it then back to afni to run the regress block (for nuisance regression for resting state analysis). My problem is that for some reasons 3dDeconvolve does not calculate the demean and derivative from the motion regressors. What am I missing in my command? Maybe I need to run 1d_tool.p and calculate the -demean and -derivative before 3dDeconvolve?
(The directory where I run this command includes the despiked dataset, and the dfile_rall.1D file)

I am using the following afni_proc.py command for the regression

afni_proc.py -subj_id ${subj}
-script proc.py_scripts2/proc_${subj}.sh
-out_dir ${top_dir}${subj}/${subj}.3dDeconvolve
-dsets ${func_dir}pb04.P1002.scale_masked_Despiked_wds.nii.gz
-blocks regress\
-regress_apply_mot_types demean deriv
-regress_extra_ortvec ${stim_times_dir}cwm.1D ${stim_times_dir}ccsf.1D\
-regress_extra_ortvec_labels cwm ccsf

My recollection is you may need to use -copy_files to copy the dfile.rall.1D info the created analysis folder. But other changes may have altered this functionality.

Can you copy/paste the generated script as well?

Hi Carolyn,

Pass the motion file using -regress_motion_file. As Peter notes, otherwise, AP does not have any file to apply for motion.

Another option is to consider adding an ‘empty’ block (to the -blocks list) to a complete AP command.
The resulting proc script would apply 3dcopy in the empty block, which you could replace with your wavelets despiking command.

  • rick

Thank you very much for your help!
I went with the -regress_motion_file option and it worked right away!

Best
Carolin