I have a question about the stim_times file. We are working on the concurrent TMS/fMRI study and here is our current setup (please see the attached figure).
TR = 3.17s
First stimulus block initiates @ 5TR (= 15.85s) and the first TMS pulse is delivered 3085ms after the first stimulus block. We deliver 3 TMS pulses during 3 blocks (volumes), followed by 7 blocks of rest.
When I create the stim_times file, I’ve used 15.85 47.55 79.25 … which are the beginning time point of the stim blocks.
-stim_times 1 stimuli/TMS.txt ‘BLOCK(3,1)’
(TMS.txt: 15.85 47.55 79.25 110.95 142.65 174.35 206.05 237.75 269.45 301.15)
Then I generate another stim_times file that indicates the actual TMS pulse triggered.
-stim_times 1 stimuli/TMS.txt ‘BLOCK(3,1)’
(TMS.txt: 18.935 50.635 82.335 114.035 145.735 177.435 209.135 240.835 272.535 304.235)
These stim_times are not matching to each TR time point but for some reasons it worked. Here is the part of output from X.stim.xmat.1D.
0
0
0
0
0
0
1.77266e-06
0.427924
0.947063
0.327283
0.0552514
0.00652992
0
0
0
0
1.77267e-06
0.427925
0.947062
0.327283
0.0552513
0.00652991
0
0
0
0
1.77268e-06
0.427926
0.947062
0.327282
0.0552512
0.0065299
0
0
0
…
Can you interpret how this stim_times file work even I did not use TR time point? Is there any efficient way to generate our stim_times file?
Can you interpret how this stim_times file work even I did not use TR time point?
With a situation where the stimulus onset times are not synchronized with the TR grids, a regressor is generated using a finer grid that roughly matches the timing resolution, and then a new regressor at the TR grids is created through up-sampling.
Is there any efficient way to generate our stim_times file?
The stimulus timings are usually used for scanning, and you should have a copy of that file. In the case where you don’t have such a file available, you may have to manually create one.
Thank you, Gang! I have one more question related to match the timing resolution.
With a situation where the stimulus onset times are not synchronized with the TR grids, a regressor is generated using a finer grid that roughly matches the timing resolution, and then a new regressor at the TR grids is created through up-sampling.
When a regressor is generated using a finer grid that matches the timing resolution, is it generated based on how close to the TR grids? For example, if the TR is 2s and the stimulus onset time is 1.8s, will the regressor be generated roughly 2s which matches the TR resolution? What if the stimulus onset time is 1s which is middle of the TR?
This is not quite correct, the regressors are not computed
on a finer grid and then downsampled.
The basis functions (GAM, BLOCK, etc.) are continuous,
and can be sampled at any time after onset (and are zero
up until that time).
So if a stimulus happens at time 17.38 with TR=2, that makes
it 1.38s into a TR. The first TR grid point following that
is at t=18, 0.62 s after the event, the next is 2.62s after,
then 4.62, etc. So the basis functions are then evaluated
at those offsets, with the resulting values going into the
regressor on the TR grid.
The event and evaluation times do not need to be on the TR
grid, as they are applied to continuous functions. This
applies to TENTs, as well.
Your original image did not get attached. Exactly what
problem are you concerned with? Is there some text that
you can post?
Thank you for your explanation. One of my concerns is how afni generates the regressors if a stimulus happens within TR.
Our TR is 3.17s and actual stimulus onset is 3085ms (I have attached our stimulus design). The first TR grid point following the first actual stimulus is at t=19.02s (6TR), 85ms after the stimulus. We have 3 blocks of this, so are the basis functions evaluated at t = 19.02s (6TR), 22.19s (7TR), and 25.36s (8TR)?
What if the actual stimulus is at 16s which is 15ms after the 5TR (15.85s)? Are the basis functions evaluated at the first TR grid point (which is 6TR, 19.02s) following the first actual stimulus? Or at the first TR grid point (5TR, 15.85s which is very close to the actual stimulus onset) before the first actual stimulus?
For a stimulus at time 16.0, yes, the first non-zero ideal
BOLD response value for that event should be at time 19.02.
You mentioned rounding the event times to the TR grid.
Doing that should lead to a similar ideal response curve,
though it should be a little different. It is more accurate
not to round event times, of course.
rick
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.