EEG triggers during a stimulus?

664 views
Skip to first unread message

Davide Quarona

unread,
May 9, 2016, 6:13:30 AM5/9/16
to E-Prime
Hi,
I have to send 8 triggers during a video to EEG, I was wodering is it possible with e-prime? I have 40 videos with different duration and I have to send a trigger in different temporal interval (from 10% to 80% of video duration).
For example I have a video that last 2000 ms. I want to say to e-prime to sent a trigger when videa reach 200 ms (10%), 400 ms (20%) and so on..
I could build 8 attributes for each video (named 10%, 20%...) and say to e- prime: send a trigger when the duration reaches that value, how can I do this?
Moreover, how can I control the delays?
Thank you

p.s.: I wasn’t able to find any suggestion or procedure on guides.

David McFarlane

unread,
May 9, 2016, 3:36:42 PM5/9/16
to e-p...@googlegroups.com
You could do this with Task Events, although with 8 triggers (markers,
signals) it could get messy. You will find documentation for Task
Events at the E-Prime Knowledge Base online, and in the New Features
Guide that came with E-Prime.

Note that you may use attribute references for the Delay in Task Events.
So in your example, you could add 8 attributes to your List just as
you said, e.g., T1, T2, etc., and set their values, e.g., 200, 400, etc.
Then add 8 Task Events to your movie stimulus, and in the Delay for
each one use [T1], [T2], etc.

So far so good, but it gets messier if you output to a parallel device
as opposed to a serial device. As I teach in my online course, in that
case E-Prime does not output pulses, it merely puts your trigger value
on the output port, and that value remains on the output until you tell
E-Prime to remove it. So you have to follow each trigger with another
"trigger" just to reset the output to 0. So now you need 16 Task Events
instead of just 8.

And then you need to set the Delay for each of those signal resets. You
could of course just add those delay values as 8 more attributes (e.g.,
"T1Reset", "T2Reset", etc.), or add a bit of inline code in your
Procedure to generate the reset delays and set the attributes on the
fly. (If you do use inline code, then pay attention to GeneratePreRun &
PreRelease, see https://groups.google.com/d/topic/e-prime/SBZ5pL0z8NE .)

In order to avoid this messiness, you might instead run a sub-List to
output your 8 triggers + trigger resets, using OnsetSignal &
OffsetSignal, or maybe even WritePort. I leave that as an exercise. In
those cases you will need some inline code.

Anybody have a more clever idea?

---------------
David McFarlane
E-Prime training online:
http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster)

Martin Yang

unread,
Oct 13, 2016, 12:31:21 PM10/13/16
to E-Prime
Hi David,

I have a similar question. I used TaskEvent in EP2.0.10 to send a response trigger (during a stimulus) via parallel port to EEG recording software (BrainVision PyCorder) with no problem. However, I'd need to switch back to EP2.0.8.9 for some reason, which doesn't have TaskEvent function. In that case, how would you send a trigger during a stimulus event? So, in short, I need to send a trigger at the onset of the stimulus and also a trigger at the onset of the response (but the onset of the response is NOT the offset of the stimulus). For stimulus onset, the following inline script works perfectly fine. So any advice on how to send a response trigger during a stimulus is much appreciated.

SoundOut.OnsetSignalEnabled = True
SoundOut.OnsetSignalPort = &H378
SoundOut.OnsetSignalData = [StmTrig]
Sleep 20

SoundOut.OffsetSignalEnabled = True
SoundOut.OffsetSignalPort = &H378
SoundOut.OffsetSignalData = 0

Thanks!

-Martin Yang

David McFarlane

unread,
Oct 14, 2016, 10:42:48 AM10/14/16
to e-p...@googlegroups.com
Martin,

Please look at the following previous discussions and see if any of them
help:

https://groups.google.com/d/topic/e-prime/z8PQMH1cf70
https://groups.google.com/d/topic/e-prime/7w5ajYuHqgw
https://groups.google.com/d/topic/e-prime/xmnq_4kSHAU
https://groups.google.com/d/topic/e-prime/OeiZ00V9SRc
https://groups.google.com/d/topic/e-prime/nVGDGTfGnhk

Search terms to help find this thread later: signal, trigger, EEG,
E-Prime 2.0.8, EP2.0.8.

-- David McFarlane

Martin Yang

unread,
Oct 18, 2016, 1:54:22 AM10/18/16
to E-Prime
Hi David,

Thanks for your help. I'll try the solutions provided in the previous posts.

Cheers,
-Martin
Reply all
Reply to author
Forward
0 new messages