How to run 3dREMLfit on already preprocessed data

Hi all, I’ve already run my proc_py scripts and now want to run a new 3dDeconvolve and 3dREMLFit on my data to get new stats and stats_REML files.

I have a 3dDeconvolve code that works, but cannot figure out how to implement 3dREMLfit in the code. Is there a flag I should be using somewhere?
Here is my code:


3dDeconvolve -input pb04.${subj}.r01.blur+orig.HEAD pb04.${subj}.r02.blur+orig.HEAD pb04.${subj}.r03.blur+orig.HEAD pb04.${subj}.r04.blur+orig.HEAD \
-mask mask_anat.${subj}+orig -censor censor_${subj}_combined_2.1D -polort 4 -float \
-num_stimts 25 \
-stim_times 1 ${stim_times_dir}SR_remembered.txt 'GAM' -stim_label 1 SR_remembered \
-stim_times 2 ${stim_times_dir}SR_forgotten.txt 'GAM' -stim_label 2 SR_forgotten \
-stim_times 3 ${stim_times_dir}SR_TH.txt 'GAM' -stim_label 3 SR_TH \
-stim_times 4 ${stim_times_dir}SR_TM.txt 'GAM' -stim_label 4 SR_TM \
-stim_times 5 ${stim_times_dir}SR_LCR.txt 'GAM' -stim_label 5 SR_LCR \
-stim_times 6 ${stim_times_dir}SR_LFA.txt 'GAM' -stim_label 6 SR_LFA \
-stim_times 7 ${stim_times_dir}OR_remembered.txt 'GAM' -stim_label 7 OR_remembered \
-stim_times 8 ${stim_times_dir}OR_forgotten.txt 'GAM' -stim_label 8 OR_forgotten \
-stim_times 9 ${stim_times_dir}OR_TH.txt 'GAM' -stim_label 9 OR_TH \
-stim_times 10 ${stim_times_dir}OR_TM.txt 'GAM' -stim_label 10 OR_TM \
-stim_times 11 ${stim_times_dir}OR_LCR.txt 'GAM' -stim_label 11 OR_LCR \
-stim_times 12 ${stim_times_dir}OR_LFA.txt 'GAM' -stim_label 12 OR_LFA \
-stim_times 13 ${stim_times_dir}NoResponse.txt 'GAM' -stim_label 13 NoResponse \
-stim_file 14 'motion_demean.1D[0]' -stim_base 14 -stim_label 14 roll_01 \
-stim_file 15 'motion_demean.1D[1]' -stim_base 15 -stim_label 15 pitch_01 \
-stim_file 16 'motion_demean.1D[2]' -stim_base 16 -stim_label 16 yaw_01 \
-stim_file 17 'motion_demean.1D[3]' -stim_base 17 -stim_label 17 dS_01 \
-stim_file 18 'motion_demean.1D[4]' -stim_base 18 -stim_label 18 dL_01 \
-stim_file 19 'motion_demean.1D[5]' -stim_base 19 -stim_label 19 dP_01 \
-stim_file 20 'motion_deriv.1D[0]' -stim_base 20 -stim_label 20 roll_02 \
-stim_file 21 'motion_deriv.1D[1]' -stim_base 21 -stim_label 21 pitch_02 \
-stim_file 22 'motion_deriv.1D[2]' -stim_base 22 -stim_label 22 yaw_02 \
-stim_file 23 'motion_deriv.1D[3]' -stim_base 23 -stim_label 23 dS_02 \
-stim_file 24 'motion_deriv.1D[4]' -stim_base 24 -stim_label 24 dL_02 \
-stim_file 25 'motion_deriv.1D[5]' -stim_base 25 -stim_label 25 dP_02 \
-iresp 1 iresp_SR_remembered_GAM.${subj} \
-iresp 2 iresp_SR_forgotten_GAM.${subj} \
-iresp 3 iresp_SR_TH_GAM.${subj} \
-iresp 4 iresp_SR_TM_GAM.${subj} \
-iresp 5 iresp_SR_LCR_GAM.${subj} \
-iresp 6 iresp_SR_LFA_GAM.${subj} \
-iresp 7 iresp_OR_remembered_GAM.${subj} \
-iresp 8 iresp_OR_forgotten_GAM.${subj} \
-iresp 9 iresp_OR_TH_GAM.${subj} \
-iresp 10 iresp_OR_TM_GAM.${subj} \
-iresp 11 iresp_OR_LCR_GAM.${subj} \
-iresp 12 iresp_OR_LFA_GAM.${subj} \
-iresp 13 iresp_NoResponse_GAM.${subj} \
-GOFORIT 12 \
-allzero_OK \
-num_glt 1 \
-gltsym 'SYM: +SR_remembered +SR_forgotten +SR_LCR +SR_LFA +SR_TH +SR_TM +OR_remembered +OR_forgotten +OR_LCR +OR_LFA +OR_TH +OR_TM +NoResponse' -glt_label 1 'All Modeled Conditions vs Baseline' \
-jobs $NUM_CPUS \
-fout -tout -x1D X.xmat_GAM.1D -xjpeg X_GAM.jpg \
-x1D_uncensored X.nocensor_GAM.xmat.1D -fitts fitts_GAM.${subj} -errts errts_GAM.${subj} -bucket stats_GAM.${subj} \

I think I’ve answered my question, but in case anyone else happens upon this post, here it is.

Looking at the output file from running the 3dDeconvolve, there is the following text to help you a long your way. It appears it spits out the exact 3dREMLfit command you should use for the particular subject. For instance:


+ ========= Things you can do with the matrix file =========
++ (a) Linear regression with ARMA(1,1) modeling of serial correlation:

3dREMLfit -matrix X.xmat_Interference.1D \
 -input "pb04.sub-102.r01.blur+orig.HEAD pb04.sub-102.r02.blur+orig.HEAD pb04.sub-102.r03.blur+orig.HEAD pb04.sub-102.r04.blur+orig.HEAD" \
 -mask mask_anat.sub-102+orig -tout -Rbuck stats_Interference.sub-102_REML -Rvar stats_Interference.sub-102_REMLvar \
 -Rfitts fitts_Interference.sub-102_REML -Rerrts errts_Interference.sub-102_REML -verb
 
++ N.B.: 3dREMLfit command above written to file stats_Interference.REML_cmd

That’s right. In fact, that is how afni_proc.py applies the -regress_reml_exec option, possibly providing additional options.

  • rick