AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
July 12, 2022 04:33PM
You are looking for what are called married regressors. Have a look at [afni.nimh.nih.gov] and search for married.

In brief, each event in a regressor will consist of onset:duration pairs, e.g., for an event that starts at T=2s and lasted 1.2s you would encode this as 2:1.2. In afni, regressors are entered in text files with one line per run and multiple events within a run separated on a line by spaces. Runs with no events are marked with a *
For example, consider a STOP signal like paradigm with 3 runs. A regressor file would look like:
2:1.2 4:1.0 5.5:0.86
*
1:0.9 10:2

So run 1 consisted or 3 events (we're keeping it short for simplicity), run two had no STOPs, and run 3 had only 2 STOPS.

Typically, you couple these with something like dmBLOCK(1) which tells 3dDeconvole you want to duration mudulated response model where the duration is taken from the bit after the : in your regressors (i.e., the duration) and the amplitude of the response model is encoded as the '1' argument to dmBLOCK. Other values are of course possible, but you have to be sure what you're doing.

If you've already got an FSL compatible file with three column regressors, something like the following will do the conversion for you

reg_file=fsl_regressors.txt
## find only lines ending in a 1,
##
## pass them to awk which then prints the first element of each
## line and the second element of each line separated by a :,
##
## then convert the newlines to a space so that AFNI's stim_times
## convention of each row being a run are observed
##
## save the results to the a file named after
## the input regressors except that it has stimtimes in the middle
## this is the conversion from fsl regressor files to afni regressor files, meaning that "onset duration that stimulus" becomes "onset:duration"
## this grep with "1$" means get the one at the end of the file
## tr means translate, takes two arguments, [set1 set2], will translate the first into the second
## the %% means cut off from the end ".txt"
grep "1$" ${reg_file} | \
awk 'BEGIN {OFS=":"} {print $1,$2}' | \
tr '\n' ' ' > ${reg_file%%.txt}.stimtimes.txt
Subject Author Posted

Use Reaction Time as the duration of the event

Lysianne July 12, 2022 04:05PM

Re: Use Reaction Time as the duration of the event

Colm Connolly July 12, 2022 04:33PM

Re: Use Reaction Time as the duration of the event

Lysianne July 12, 2022 04:38PM

Re: Use Reaction Time as the duration of the event

Daniel Glen July 12, 2022 05:07PM

Re: Use Reaction Time as the duration of the event

Lysianne July 12, 2022 05:18PM

Re: Use Reaction Time as the duration of the event

Lysianne July 13, 2022 10:20AM

Re: Use Reaction Time as the duration of the event

Colm Connolly July 13, 2022 03:42PM

Re: Use Reaction Time as the duration of the event

Lysianne July 13, 2022 05:06PM

Re: Use Reaction Time as the duration of the event

Colm Connolly July 14, 2022 09:36AM