3dTshift tzero clarification

Hello! I would like to make sure I am understanding the default settings of 3dTshift correctly. I’m working with data that I have run through fmriprep so that tzero is not set to 0 as in afni_proc.py. Based on some other posts on this board, I believed I needed to subtract ~1/2 TR from my onset times to make the model in 3dDeconvolve reflect the slice time corrected data. It was my understanding that 3dTshift temporally aligns the data to the average of the slice times, which in my case is ~970 ms.

I just discovered this blog post that instead says that AFNi users should add ~1/2 TR to onset times if preprocessing is done with fmriprep: https://reproducibility.stanford.edu/slice-timing-correction-in-fmriprep-and-linear-modeling/

If I have a TR of 2 seconds and my original volumes are 0, 2, 4, 6, . . . seconds, after 3dTshift, they become approximately 1, 3, 5, 7 . . . right? In that case, shouldn’t an event that happened at 6 seconds after the start of my run actually be coded as 5 seconds in the model to account for the first volume moving forward by ~1 second? It seems to me that adding ~1/2 TR would instead move the starting point of the run backward in time, but I might be misunderstanding something fundamental here.

As always, thanks for the advice!
Anthony

EDIT: Rick responded with deeper knowledge on how 3dDeconvolve does things and after me debating this with him several times, I’ll direct you to his response below.

I think Anthony is correct here, users should subtract ~TR/2 from the stimulus times (actually (N-1)/N * TR/2 s, assuming N slices are evenly distributed over the TR), but TR/2 is close enough if there are many slices. Adding it would double the problem people might be experiencing mixing these packages.

Suppose TR=2s and the first event is at time t=1s. The offset of that event from the beginning of the run and from the beginning of the initial volume is 1s. But if the slices are shifted so it is as if they were acquired also at time t=1s (approximately), then the offset for that first event should be t=0, since it would correspond to the time of that initial volume. Notably, an event originally at time t=0 would now occur “before” the first volume. Complications…

If tshift were used to make it as if the volumes were acquired later, then the events would seem to occur earlier, relative to the timing of the data.

• rick

Thanks so much, Rick and Peter!

Anthony