Design matrix and 3dDeconvolve

Dear afni experts,

I’d like to use 3dDeconvolve with a block-design paradigm. Each functional run consists of an active block (3 minutes), short break (20 seconds) and a passive block (3 minutes) lasting for 380 seconds in total. The TR is 2.5 s and there are 3 functional scans each of which with 152 volumes. I have used the following arguments to run the command which works with no errors. However, when I plot run-all_X.xmat.1D, the predicted fit for the active block does not match the stimulus timing in ‘stim_active.txt’ (see the attachments). Based on the plot, it seems that the active block was on during the whole run i.e. form volume 0 to 151 while the .txt file shows that it ends at 180 seconds. I’m not sure what has gone wrong here and would greatly appreciate hearing your thoughts. Thank you!

3dDeconvolve -input run-all.nii.gz
-concat ‘1D: 0 152 304’
-polort 3
-num_stimts 2
-stim_times 1 stim-active.txt ‘BLOCK(180,1)’ -stim_label 1 Active
-stim_times 2 stim-passive.txt ‘BLOCK(180,1)’ -stim_label 2 Passive
-gltsym ‘SYM: Active -Passive’ -glt_label 1 A-P
-tout -x1D run-all_X.xmat.1D -xjpeg run-all_X.jpg
-fitts run-all_fitts -bucket run-all_func
-jobs 10


From what you are saying the stim-active.txt file should not have those events at time 180 (time 180 should be for passive). As it stands, there are events at 0 and at 180, and each lasts for 180 s, which is the same as a single event that lasts for 360 s.

So stim-active.txt should probably look like:

0 *
0 *
0 *

Where the ‘*’ characters are to make it look like “local” timing, rather than global. Otherwise, you could put “-local_times” before the -stim_times options. and just have a column of 0’s.

Note that the results might be surprisingly noisy. The blocks are very long, so baseline drifts highly correlate with the regressors of interest. Also, the 2 regressors of interest will have correlations close to -1, they are almost negatives of each other (their sum would be practically a flat line). That seems a bit problematic.

  • rick