Stimulus files for correct and incorrect responses

I have a large sample of task-based fMRI’s in an event-related design. There was only a single run for each participant. Participants either respond or not respond to a target or foil image. So there are four events I want to model in the GLM for each subject:

1: RT: Response to target
2. RF: Response to foil
3. NT: No response to target
4. NF: No response to foil

For each subject, there is a respective stimulus file containing timings associated with the four event types. Suppose they are respectively called RT.1D, RF.1D, NT.1D, and NF.1D. Lines in the afni_proc.py command would look like:


	-regress_stim_times RT.1D RF.1D NT.1D NF.1D \
	-regress_stim_labels RT RF NT NF \
	-regress_local_times \ 
        ....
        -	-num_glt 6 \
	-gltsym 'SYM: +RT' -glt_label 1 'beta_RT' \
	-gltsym 'SYM: +RF' -glt_label 2 'beta_RF' \
	-gltsym 'SYM: +NT' -glt_label 3 'beta_NT' \
	-gltsym 'SYM: +NF' -glt_label 4 'beta_NF' \
	-gltsym 'SYM: +RT -RF' -glt_label 5 'beta_RT_minus_RF' \
	-gltsym 'SYM: +NT -NF' -glt_label 6 'beta_NF_minus_NF' \
        ...

Since I’m runing many subjects, I want to use the same afni_proc.py script with environmental variable for subject ID used to specify directories and raw files.

There may be some subjects who, for example, never responded to a foil (i.e., #RF = 0). or responsed to all targets (#NT = 0). In this case, the RF.1D file or NT.1D files would be empty. Outside of using further bash scripting + environmental variables for referring to file names, can AFNI recognize an empty file as referring to no stimulus taking place? So if #RF = 0, the above code would produce a GLM with only three covariates for RT, NT, and NF? Similarly, the GLT’s containing references to RF (under labels 2 & 5) would not be evaluated.

I read the 3dDeconvolve documention, which states

*** In the case where the stimulus doesn't actually exist in the   
    data model (e.g., every line in 'tname' is a '*'), you will    
    also have to use the '-allzero_OK' option to force 3dDeconvolve
    to run with regressor matrix columns that are filled with zeros.

Does this mean I can use the same script for every subject, even if one of the classes — NT, NF, RT, or RF — has no stimulus, so long as I include the option “-allzero_OK”?

Thank you for your attention.

Hello,

Note that the first 4 GLTs are not needed, as they are
identical to the simple betas that 3dDeconvolve outputs
anyway.

Yes, using -allzero_OK tells the program that such files
are okay. Except that is not sufficient, since it also
computes condition numbers, which will look bad with the
zero vectors. So you will probably need something like
“-GOFORIT 6”, or whatever level it complains about.

Those can be added to all of the commands.

The danger lies in the possibility that you make some
other mistake with the timing files. Since it would
be telling 3dDeconvolve not to worry about a small
number of problems, you might not realize if a timing
file is messed up in some other way.

  • rick

Thank you Rick!