doing GLM with 3dDeconvolve what kind of stim_files to input?

Hi AFNI group:

I am tring to do GLM with 3dDeconvolve. What I am wondering is, the stim_files input to 3dDeconvolve should be 0/1 code with 1 representing stimuli and 0 representing absence of stimuli, or should I transfer the 0/1 coding with HRF?

The “usual” way to use 3dDeconvolve is to provide a timing file that gives the start times for each stimulus (which are not required to be on the TR timing grid) – this file is specified using the -stim_times option.

For the HRF, you choose a model function to define the shape of the response for the stimulus. There are many options for that.

The “best” way to run 3dDeconvolve (or its daughter program, 3dREMLfit) is to use the AFNI super script – whose help is here. This script takes as input the anatomical and EPI datasets, plus the timing files, and will run the entire analysis for you: aligning the anatomical and EPI datasets together and to MNI/Talairach space, running the GLM analysis, and writing out some simple diagnostic reports about the data.

Hi Bob
Thank you for your response.

I have already done preprocessing. So instead of using -stim_files, -stim_times is more properly? And I need to transfer the 1/0 1Dfile into stime_time files, maybe using
Am I right?

so, anyway, inputting 1/0 1dfiles directly as -stim_files is not right?

It is possible to use -stim_files with 0/1 files correctly, but it is not easy. It is better to use to convert the 0/1 files to timing files.

If you want a fixed shape HRF, then ‘BLOCK(d,1)’ is a good starting choice, where the number d is replaced by the duration of the stimulus (in seconds).

If you want a variable shape HRF (also known as a FIR model), you can use ‘TENT(d,n)’ or ‘TENTzero(d,n)’ as the model function, where now d=expected duration of BOLD response (typically the stimulus duration + 12 seconds), and n=number of parameters in the model (typically one every 2 s or so, so n=1+d/2 is reasonable).

AFNI gives you a lot of control over your analysis, and the price you pay for that is you have to understand the options to be able to make an intelligent choice.

I strongly encourage you to do the analysis with and let it set up all the pre-processing and analysis. It will (1) make your life easier, and (2) make it easier for us to help you.

Thanks you Bob
Really appreciate!