3dDeconvolve -Local Times

Hello - I am still pretty new to afni. Currently, I am using the TENT function to model BOLD in a block style task. The stimulus times are stacked according to the order of runs in the first column of each text file. When writing the script and flagging -Local times I get the error below:

++ ** GUESSED ** -stim_times 1 using GLOBAL times
*+ WARNING: ‘-stim_times 1’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?
++ ** GUESSED ** -stim_times 2 using GLOBAL times
*+ WARNING: ‘-stim_times 2’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?
++ ** GUESSED ** -stim_times 3 using GLOBAL times
*+ WARNING: ‘-stim_times 3’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?
++ ** GUESSED ** -stim_times 4 using GLOBAL times
*+ WARNING: ‘-stim_times 4’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?
++ ** GUESSED ** -stim_times 5 using GLOBAL times
*+ WARNING: ‘-stim_times 5’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?
++ ** GUESSED ** -stim_times 6 using GLOBAL times
*+ WARNING: ‘-stim_times 6’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?
++ ** GUESSED ** -stim_times 7 using GLOBAL times
*+ WARNING: ‘-stim_times 7’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?
++ ** GUESSED ** -stim_times 8 using GLOBAL times
*+ WARNING: ‘-stim_times 8’ (GLOBAL) has 2 runs and 2 early events; do you want LOCAL times?

Stim Files are (in ms) for Run1 and Run2 by Block onset in each run:
7.8
134.0

Here is how I scripted it:
3dDeconvolve -input files_by_run.nii
-polort A
-num_stimts 8
-CENSORTR 1:0…4
-CENSORTR 2:0…4
-ortvec ${subject}_MovReg.txt motion
-ortvec ${subject}_CSFReg.txt csf
-ortvec ${subject}_WMReg.txt wm
-ortvec ${subject}_WM_GSR_Reg.txt
-local_times
-stim_times 1 ${subject}b1.txt ‘TENT(0, 30.96,44)’ -stim_label 1 b1
-stim_times 2 ${subject}b2.txt ‘TENT(0, 30.96,44)’ -stim_label 2 b2
-stim_times 3 ${subject}b3.txt ‘TENT(0, 30.96,44)’ -stim_label 3 b3
-stim_times 4 ${subject}b4.txt ‘TENT(0, 30.96,44)’ -stim_label 4 b4
-stim_times 5 ${subject}b5.txt ‘TENT(0, 30.96,44)’ -stim_label 5 b5
-stim_times 6 ${subject}b6.txt ‘TENT(0, 30.96,44)’ -stim_label 6 b6
-stim_times 7 ${subject}b7.txt ‘TENT(0, 30.96,44)’ -stim_label 7 b7
-stim_times 8 ${subject}b8.txt ‘TENT(0, 30.96,44)’ -stim_label 8 b8
-iresp 1 b1.nii
-iresp 2 b2.nii
-iresp 3 b3.nii
-iresp 4 b4.nii
-iresp 5 b5.nii
-iresp 6 b6.nii
-iresp 7 b7.nii
-iresp 8 b8.nii
-num_glt 12
-gltsym “desired contrasts here” label_for contrast
-rout
-tout
-bucket FIR_model_stats.nii
-GOFORIT 100
-noFDR
-nocout
-errts Residuals.nii
-allzero_OK
-jobs 10

Is there an issue I can change in the way I have organized the 3dDeconvolve commands so I can force the apropriate flag -local_times since the way I have done it (flagged -local_times before stim inputs) does not seem to work?

Hello,

Sorry for being a bit slow on this.

To be sure, the stimulus times should be in seconds not milliseconds, though 7.8 and 134.0 look like seconds.

Those warnings suggests that all of the stimulus times seem to be in the first run. When you say the “times are stacked according to the order of runs”, what does that imply about the times, are they offset from the beginning of each run (seems likely), or are they all offset from the beginning of the first run?

Let’s assume each run is 200s long, for example. If the times looks like:

27.3
115.6
183.4
11.9
79.0
158.2

That would be giving offsets from the beginning of each respective run. It is also an invalid format for 3dDeconvolve.

The “global timing way” would be with times from the beginning of the first run, as with:

27.3
115.6
183.4
211.9
279.0
358.2

If you prefer times local to each run, then run times should be on a single row, as in:

27.3 115.6 183.4
11.9 79.0 158.2

Does that seem reasonable?

A separate question might be whether you would rather use afni_proc.py for the analysis, but we can leave that for another conversation. :slight_smile:

  • rick