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  

|
October 24, 2019 12:04PM
Hello AFNI experts -

I am developing a rapid event event related design with jittered ITI and random stimulus presentation. The experiment is as follows:

Cue(variable time) - task stimulus (fixed time) - ITI (variable time). There are 2 cue conditions (C1, C2) and 2 task conditions (T1, T2). T1 always follows C1 and T2 always follows C2. There will also be catch trials of C1 and C2. Random stimulus presentation may therefore look like the following:

C1T1... C2T2......C1T1...C2.....C2T2....C2....C1.......C1T2

Based on the examples listed here I believe the "Catch Trial" example is most appropriate. I've included my code below.

I am having a few issues:
1. First, is my interpretation of this example appropriate for the task I've described?
2. I need my stimuli to be TR locked and I must have a minimum TR of 2.5s. Ideally this would be facilitated through a combination of jittered cue and jittered ITI, with fixed task. For example...
Full trial: 1.25 cue + 1.5 task + 2.25 ITI = 5 s
Full trial: 1.75 cue + 1.5 task + 1.75 ITI = 7.5 s
Catch trial: 1.75 cue + 3.25 ITI = 5 s
However, I've been unable to incorporate this type of variable jitter into a stimulus, and so the math never quite works out to allow me to have appropriate timing for both my catch trials+rest and my full trials+rest while fitting within the bounds of a multiple of my 2.5s TR. Are there any suggestions for workarounds?

Thank you for your assistance,
Kathryn




#!/bin/tcsh

# try to find reasonable random event related timing given the experimental
# parameters

# ---------------------------------------------------------------------------
#num_stims: 4 (C1, C2, T1, T2)
#stim_dur: C1: 1.25 C2: 1.25 / T1: 1.25 T2: 1.25 (for initial analysis T1, T2 = 1.25*2 = 2500)
#run_time: [(1.25*9 + 1.25*9 + 2.5*16 + 2.5*16 + (9+9+16+16)*2.5)] * 2 = 705
#tr_locked: TR = 2.5
# ---------------------------------------------------------------------------

# ---------------------------------------------------------------------------
#generate stimulus timing for 4 classes
# ---------------------------------------------------------------------------
make_random_timing.py -num_stim 4 -num_runs 4 -run_time 705 \
-stim_dur 1.25 1.25 2.5 2.5 -num_reps 9 9 16 16 \
-stim_labels C1 C2 T1 T2 -min_rest 2.5 -tr_locked -tr 2.5 -seed 54321 \
-prefix stimesG

# ---------------------------------------------------------------------------
#separate 'catch' trials from the main events and sort
# ---------------------------------------------------------------------------
1dcat stimesG_C1.1D stimesG_T1.1D > stimesG_C1T1_all.1D
1dcat stimesG_C2.1D stimesG_T2.1D > stimesG_C2T2_all.1D

timing_tool.py -timing stimesG_C1T1_all.1D -sort \
-write_timing stimesG_C1T1_sorted.1D
timing_tool.py -timing stimesG_C2T2_all.1D -sort \
-write_timing stimesG_C2T2_sorted.1D

# ---------------------------------------------------------------------------
#get stim times for 'main' regressors by adding 1.25 seconds to every time
#run make_random_timing.py again, adding an offset of 1.25 seconds to all times
#save 3dDeconvolve command to run with -nodata
# ---------------------------------------------------------------------------
make_random_timing.py -num_stim 4 -num_runs 4 -run_time 705 \
-stim_dur 1.25 1.25 2.5 2.5 -num_reps 9 9 16 16 \
-stim_labels C1 C2 T1 T2 -min_rest 2500 -tr_locked -tr 2.5 -seed 54321 \
-offset 1.25 - save_3dd_cmd @cmd.3dd.G -prefix stimesG

# ---------------------------------------------------------------------------
#Fix the 3dDeconvolve command in @cmd.3dd.G
#Use timing files for stimesG_C1T1_sorted.1D and stimesG_C2T2_sorted.1D
# ---------------------------------------------------------------------------
Subject Author Posted

Catch trials or partially fixed stimulus ordering with make_random_timing.py

kunruh October 24, 2019 12:04PM

Re: Catch trials or partially fixed stimulus ordering with make_random_timing.py

rick reynolds October 25, 2019 09:41AM

Re: Catch trials or partially fixed stimulus ordering with make_random_timing.py

kunruh November 14, 2019 11:02AM

Re: Catch trials or partially fixed stimulus ordering with make_random_timing.py

kunruh November 15, 2019 03:17PM

Re: Catch trials or partially fixed stimulus ordering with make_random_timing.py

rick reynolds November 20, 2019 08:55PM