AFNI Analysis: Choosing stim_times_AM1 vs. stim_times_AM2 and Using dmUBLOCK() for Modeling Condition Differences with Duration and Preference Ratings

Hello everyone,

I have a question regarding using AFNI to analyze fMRI data. In my study, each participant views three different types of food images (representing three conditions: bundle, scale, single) and provides a preference rating for each food item. Once the participant responds, the trial ends, so the duration is essentially the participant’s reaction time, unless they take more than 4 seconds to respond.

If I only want to compare the activation differences across the three conditions, is it appropriate to use stim_times_AM1? I noticed that the timing files in AFNI generally don’t include duration information, which differs from FSL’s event files. In FSL, the event files have onset time in the first column, duration in the second, and weight in the third. However, in AFNI, duration time seems to be absent from the timing files. How can I incorporate the duration information for each trial into the model? Should I specify it in the dmUBLOCK() parameter? Additionally, based on my study design, is it reasonable to use dmUBLOCK()? I also saw recommendations for using dmUBLOCK(-). How should I decide which one to choose?

Additionally, if I want to include the participants’ preference ratings for each item in the model, should I switch to using stim_times_AM2? In that case, should the timing file (.1D) have two columns of weights: one with all values set to 1 (to capture activation differences across conditions) and the second with the mean-centered preference scores?

Below is my code, which only compares brain activation across different conditions. I really appreciate any help!

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 

some of the AFNI developers answer questions on neurostars but I think if you want the most number of AFNI-expert eyes on this (good) question you should also try the AFNI Discussion list: https://discuss.afni.nimh.nih.gov/

1 Like

I posted a response on the AFNI message board, but will duplicate that part here for serachability.

Hello,

A quick overview:

A complete event, with an onset, multiple amplitude modulators and a duration is specified with the format: ONSET*AMP_1*AMP_2:DURATION, as in 15.3*1.4*-0.8:2.1.

In the case of only duration modulation (e.g. 15.3:2.1, for an event at time 15.3 of duration 2.1 seconds), one would use -stim_times_AM1 (as you are). In this case, if you were to use both an amplitude modulator (preference rating, like 1.4) and a duration (like 2.1), an event might look like 15.3*1.4:2.1 .

With any amplitude modulator, one would usually use -stim_times_AM2. This would apply whether there are attached durations or not. It gives separate regressors/betas for the mean response and the modulation response.

While 3dDeconvolve can read FSL-formatted timing files, afni_proc.py will not (though they could be converted via timing_tool.py -fsl_timing_files. See timing_tool.py -help output for details or an example.

For your questions…

Using stim_times_AM1 is indeed appropriate, but basically only when events have only durations attached.

Using dmUBLOCK(-) works well when the mean duration is not close to either 0 or 15s. The parameter to dmUBLOCK affects only the scaling of the regressors/betas. So it does not affect single subject statistics, but it can affect group statistics if the mean duration varies across subjects. In such as case, it is good to use something like dmUBLOCK(-4.2) if the mean response time across all subjects is 4.2 s. This allows the betas to be appropriately compared across subjects and groups.

See : dmBLOCK options for a discussion about dmBLOCK/dmUBLOCK.

  • rick
1 Like