Trigger pulse and precise timing of stimulus onset

142 views
Skip to first unread message

Meghan Bennett

unread,
Sep 14, 2023, 2:32:43 PM9/14/23
to E-Prime
Hi,

I've had an issue come up for this task in an fMRI study I'm running. The task includes brief instructions for the participant, followed by a conditioning task. The task is designed to wait for the scanner pulse to start the task (after the instructions). I am trying to identify the exact onset time of each stimulus presentation, but it appears that the timing of the stimuli isn’t reflecting time since the pulse but rather time since the launch of the task (instructions). 
Would anyone be able to direct me how to code this (or if there is a feature I should select in properties) that would allow the onset times of the stimuli to reflect time since trigger and not time since task begin?
Thank you!
Meghan

McFarlane, David

unread,
Dec 7, 2023, 3:39:48 PM12/7/23
to e-p...@googlegroups.com
Meghan,

Sorry for the delay, I had some things come up ...

OnsetTime for each stimulus gives a timestamp for the start of presentation, with the start of the session at 0. (See also discussion at https://groups.google.com/d/topic/e-prime/OeiZ00V9SRc)

Suppose ScannerSync is the object that waits for the first scanner pulse, and StimSlide is your stimulus Slide. If you log ScannerSync.OnsetTime and StimSlide.OnsetTime, then you could always calculate stimulus onset from the start of the scan as

StimSlide.OnsetTime - ScannerSync.OnsetTime

You could do that after the session based on the results in the data (.edat*) file. Or if you like you could add some InLine code to handle this, e.g.,

c.SetAttrib StimSlide.ScanTime, StimSlide.OnsetTime - ScannerSync.OnsetTime

Of course, if you have an existing body of data that did not bother to log ScannerSync.OnsetTime then you have a problem. But if you used Cumulative timing mode throughout your study then everything in your task should have stayed synchronized with the scanner after the first pulse and you could work backwards to derive a time stamp for the scanner pulse.

-- David McFarlane

McFarlane, David

unread,
Dec 7, 2023, 4:04:47 PM12/7/23
to e-p...@googlegroups.com
Oops, big mistake in what I posted earlier -- you do not want ScannerSync.OnsetTime, you want ScannerSync.RTTime, which gives a time stamp for when E-Prime detected the scanner pulse.

So you would calculate stimulus onset from the start of the scan as

StimSlide.OnsetTime - ScannerSync.RTTime

and you could use InLine code to log this as

c.SetAttrib StimSlide.ScanTime, StimSlide.OnsetTime - ScannerSync.RTTime

Sorry about that!

-- David McFarlane


On 2023-12-07 Thu 3:39 PM, McFarlane, David wrote:
> Meghan,
>
> Sorry for the delay, I had some things come up ...
>
> OnsetTime for each stimulus gives a timestamp for the start of presentation, with the start of the session at 0. (See also discussion at https://urldefense.com/v3/__https://groups.google.com/d/topic/e-prime/OeiZ00V9SRc__;!!HXCxUKc!0rt1PpjE7k_rbxyKB3ioPYAOIAb2RYFzp6xsxkvPC5ePt0e8tbiLjQPkSgCnSkFOvHDbf2hWwhkpN1-Y0w$ )
Reply all
Reply to author
Forward
0 new messages