AFNI version info (Version AFNI_26.0.09 'Pupienus Maximus'):
Hello, I'm new to using afni and have completed whole playlists of the bootcamp. I'm now trying to sharper my understanding of it using some of the datasets coming out of the lab I work in.
I'm encountering a mystery that I can't quite resolve. In our experimental design, there are two consecutive scans, and they're operationalized as early and late sessions during first late analysis. Different conditions (two timing files with two rows in each) during each session are analyzed so that in the first-level analysis, we have cond1 contrasted with early vs late sessions or the average between cond1 and cond2 contrasted with early vs late sessions.
I've read the 3dDeconvolve documentation to determine if such contrasts can be tested, but it wasn't clear to me how to implement them. The decon page listed in the 'gltsym' section for 3dDeconvolve appears to suggest subscripting via time lags, but that throws an error when I try it either using a scalar subscript ('cond1[1]') or as detailed on the page ('cond1[10..20]'). I've searched through the message board and others seem to have a similar design, but none seem to point in a direction of how to contrast between separate runs at the first level. I notice that group-level functions that provide something like this, but I wonder if there is a way to provide that analysis in afni_proc?
Just to be sure on a couple of things, these early and late sessions are 2 different scanning sessions, where the subject has left the scanner (gone home?) and come back for the late session, is that right?
And are these 2 separate afni_proc.py processes, or just one?
The runs are run consecutively after a brief intermission (~5). It is to examine habituation, which after reviewing further some of the voxelwise calc functions, it seems that those functions would be appropriate.
That sounds good, thanks. But just to be positive, does the subject leave the scanner during that intermission? Probably not, given that it is only 5 minutes, but it is good to be sure.
From the description, I would expect you to have perhaps 4 different timing files, cond1_early, cond1_late, cond2_early, cond2_late. Then you could use gltsym to directly compare any of them. The subscripts should not be needed, they are for when there are multiple basis functions in the response model term, such as when using TENTs, SPMG3, IM or amplitude modulators.
Feel free to post some of your 3dDeonvolve command to clarify.
Hello Rick, thanks for the suggestion! I recently tried that and the proc script threw errors, but I hadn't included * in the respective lines for timing files as detailed in some documentation. Now the script has run successfully. Below is the 3dDeconvolve function.
It's great the script is running. Yes, if there are runs without events, it is good to use something like '* *' as a placeholder for the empty runs (using 2 to emphasize local timing).
Since you are indeed using TENTs, note that the GLTs are "area under the curve" versions, adding all betas. If you did want just the initial tent beta, it would be something like 'cse1[0]'.
Note that the TENT functions should include the entire BOLD response time, so it is possible that these functions are not long enough.
I guess your TR is 2.5s, since TENT(-1,4,3) have that spacing.
That first symbolic GLT is concerning. I am not sure how 3dDeconvolve will take the space after the minus symbol. Maybe it should read (without the space):
Thank you for pointing out that typo. That wasn't intended.
The TR is 2s. I wrote the TENT function to reflect the formulae in the variable-shape time series bootcamp: L = D/(n-1). I choose the lesser of the L = 2 or L = 4 for exploratory reasons. I assume that the option between the two is determined by whether it causes some of the cons mentioned on slide 76. Although, I realize now that the bootcamp refers to TENTzero, not TENT.
The experiment I'm analyzing has a stimulus presented for 4s and another stimulus may or may not co-terminate (~1s) with it during each trial. I include -1 for any anticipatory response. Does my choice of n in TENT(b,c,n) have to satisfy the L formulae mentioned above?
The -1 makes it a 5 second window, and with 3 knots that makes 2 intervals of 2.5 s.
To include a possible 12 (more?) second BOLD response, plus the -1s anticipation, plus the stimulus duration, you might even consider modeling for 1+12+4 = 17 seconds. Let's call it 16. So consider:
With this TENT function, subscripting would be useful to extract the relevant beta coefficient's at timepoints of interest?
Also, as an aside and perhaps silly question, in the variable-shape models bootcamp recording the visualization below is shown as an illustration of the model's results. I assume the plot shows the beta coefficients from the TENT function, am I correct? And if so, is there a function to extract and plot those results? In my afni version, there's no AFNI_data2 folder.
Yes, if you wanted a GLT that evaluated part of the response, subscripting would work well. Gang might have some more advanced methods though, which would include fitting those curves with smoother splines.
Yes, that plot from the bootcamp recordings shows the set of TENT betas, viewed as the HRF from those events. If you use afni_proc.py for the analysis, it will automatically add -iresp options for the TENT classes in the 3dDeconvolve command to generate such datasets. They are generally just extracted betas from the -bucket dataset into separate ones, but they are indeed convenient to have.
If you want to model a 16-second hemodynamic response with a TR of 2 seconds, TENT(0,16,9) is an appropriate choice.
To compare the average response profile (rather than the area under the curve) between the first and second sessions across two conditions (e.g., cse and csm), you can use the following symbolic notation:
This approach tests for differences in the overall shape of the response. For expanding this to a group-level analysis, please refer to this blog post for a detailed walkthrough on profile estimation.
Gang Chen
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.