AFNI First Level Analysis: Handling Motion Regressors Across Multiple Runs

Hi everyone,

I conducted a first-level analysis using AFNI, and I noticed something about the motion regressors. When I save the 6 motion regressors from each run as separate files, in the generated X.jpg, each run ends up having its own 6 motion regressors, taking up six columns as shown in the image below. However, I followed Andrew Jahn’s tutorial on YouTube, and in his example, the motion regressors for different runs are the same 6 across runs. Is my approach correct? Thank a lot!

My X.jpg for 5 runs within one subject

Andrew’s sample:

My 3dDeconvolve code:

# 使用合并后的事件文件
    3dDeconvolve -GOFORIT 3 \
        -input ${event_dir}/run*_scale.nii \
        -mask ${event_dir}/full_mask.nii \
        -polort 3 \
        -num_stimts 33 \
        -stim_times_AM1 1 ${event_dir}/bundle.1D "dmUBLOCK(1)" \
        -stim_label 1 bundle \
        -stim_times_AM1 2 ${event_dir}/scale.1D "dmUBLOCK(1)" \
        -stim_label 2 scale \
        -stim_times_AM1 3 ${event_dir}/single.1D "dmUBLOCK(1)" \
        -stim_label 3 single \
        -stim_file 4 ${event_dir}/trans_x_run1.txt -stim_base 4 -stim_label 4 trans_x_01 \
        -stim_file 5 ${event_dir}/trans_y_run1.txt -stim_base 5 -stim_label 5 trans_y_01 \
        -stim_file 6 ${event_dir}/trans_z_run1.txt -stim_base 6 -stim_label 6 trans_z_01 \
        -stim_file 7 ${event_dir}/rot_x_run1.txt -stim_base 7 -stim_label 7 rot_x_01 \
        -stim_file 8 ${event_dir}/rot_y_run1.txt -stim_base 8 -stim_label 8 rot_y_01 \
        -stim_file 9 ${event_dir}/rot_z_run1.txt -stim_base 9 -stim_label 9 rot_z_01 \
        -stim_file 10 ${event_dir}/trans_x_run2.txt -stim_base 10 -stim_label 10 trans_x_02 \
        -stim_file 11 ${event_dir}/trans_y_run2.txt -stim_base 11 -stim_label 11 trans_y_02 \
        -stim_file 12 ${event_dir}/trans_z_run2.txt -stim_base 12 -stim_label 12 trans_z_02 \
        -stim_file 13 ${event_dir}/rot_x_run2.txt -stim_base 13 -stim_label 13 rot_x_02 \
        -stim_file 14 ${event_dir}/rot_y_run2.txt -stim_base 14 -stim_label 14 rot_y_02 \
        -stim_file 15 ${event_dir}/rot_z_run2.txt -stim_base 15 -stim_label 15 rot_z_02 \
        -stim_file 16 ${event_dir}/trans_x_run3.txt -stim_base 16 -stim_label 16 trans_x_03 \
        -stim_file 17 ${event_dir}/trans_y_run3.txt -stim_base 17 -stim_label 17 trans_y_03 \
        -stim_file 18 ${event_dir}/trans_z_run3.txt -stim_base 18 -stim_label 18 trans_z_03 \
        -stim_file 19 ${event_dir}/rot_x_run3.txt -stim_base 19 -stim_label 19 rot_x_03 \
        -stim_file 20 ${event_dir}/rot_y_run3.txt -stim_base 20 -stim_label 20 rot_y_03 \
        -stim_file 21 ${event_dir}/rot_z_run3.txt -stim_base 21 -stim_label 21 rot_z_03 \
        -stim_file 22 ${event_dir}/trans_x_run4.txt -stim_base 22 -stim_label 22 trans_x_04 \
        -stim_file 23 ${event_dir}/trans_y_run4.txt -stim_base 23 -stim_label 23 trans_y_04 \
        -stim_file 24 ${event_dir}/trans_z_run4.txt -stim_base 24 -stim_label 24 trans_z_04 \
        -stim_file 25 ${event_dir}/rot_x_run4.txt -stim_base 25 -stim_label 25 rot_x_04 \
        -stim_file 26 ${event_dir}/rot_y_run4.txt -stim_base 26 -stim_label 26 rot_y_04 \
        -stim_file 27 ${event_dir}/rot_z_run4.txt -stim_base 27 -stim_label 27 rot_z_04 \
        -stim_file 28 ${event_dir}/trans_x_run5.txt -stim_base 28 -stim_label 28 trans_x_05 \
        -stim_file 29 ${event_dir}/trans_y_run5.txt -stim_base 29 -stim_label 29 trans_y_05 \
        -stim_file 30 ${event_dir}/trans_z_run5.txt -stim_base 30 -stim_label 30 trans_z_05 \
        -stim_file 31 ${event_dir}/rot_x_run5.txt -stim_base 31 -stim_label 31 rot_x_05 \
        -stim_file 32 ${event_dir}/rot_y_run5.txt -stim_base 32 -stim_label 32 rot_y_05 \
        -stim_file 33 ${event_dir}/rot_z_run5.txt -stim_base 33 -stim_label 33 rot_z_05 \
        -jobs 8 \
        -fout -tout -x1D ${event_dir}/X.xmat.1D -xjpeg ${event_dir}/X.jpg \
        -x1D_uncensored ${event_dir}/X.nocensor.xmat.1D \
        -fitts ${event_dir}/fitts.${subj} \
        -errts ${event_dir}/errts.${subj} \
        -bucket ${event_dir}/stats.${subj} \
        -gltsym 'SYM: -single' -glt_label 1 neg_single \
        -gltsym 'SYM: -scale' -glt_label 2 neg_scale \
        -gltsym 'SYM: -bundle' -glt_label 3 neg_bundle \
        -gltsym 'SYM: +bundle -single' -glt_label 4 bundle_single \
        -gltsym 'SYM: -bundle +single' -glt_label 5 single_bundle \
        -gltsym 'SYM: +bundle -scale' -glt_label 6 bundle_scale \
        -gltsym 'SYM: -bundle +scale' -glt_label 7 scale_bundle \
        -gltsym 'SYM: +scale -single' -glt_label 8 scale_single \
        -gltsym 'SYM: -scale +single' -glt_label 9 single_scale 

Howdy-

It looks like the difference between regression out motion per-run, or as concatenated regressors. Using afni_proc.py, we would often recommend adding “-regress_motion_per_run”. This is to “better account for motion-correlation variance” (from here, and similarly noted here). I am guessing that in the Andrew’s tutorial, he did not include that option in processing?

From the afni_proc.py help describing this opt:

-regress_motion_per_run : regress motion parameters from each run

        default: regress motion parameters catenated across runs

    By default, motion parameters from the volreg block are catenated
    across all runs, providing 6 (assuming 3dvolreg) regressors of no
    interest in the regression block.

    With -regress_motion_per_run, the motion parameters from each run
    are used as separate regressors, providing a total of (6 * nruns)
    regressors.

    This allows for the magnitudes of the regressors to vary over each
    run, rather than using a single (best) magnitude over all runs.
    So more motion-correlated variance can be accounted for, at the
    cost of the extra degrees of freedom (6*(nruns-1)).

    This option will apply to all motion regressors, including
    derivatives (if requested).

–pt

1 Like