canvas and 0 duration objects collecting responses

Peter Quain pquain at metz.une.edu.au
Wed Aug 17 01:34:43 UTC 2005


Thought this might be of interest (if i've got it right).

When presenting stimuli using code (in an Inline object, manipulating the 
canvas object) pst recommend collecting input using the input masks from an 
object with zero duration and infinite wait for response immediately 
preceding the Inline. My immediate (code naive) take on the logic of this 
was that the dummy object and the screen drawing code executed at the same 
time, thus synchronising stimulus presentation, the time stamp for 
calculating RT etc., and, importantly, any marker pulses sent to external 
equipment.

Of course, code execution in e-prime is sequential. The following output 
comes from running the e-prime example script (adjusted for a single loop) 
'CollectInputDuringInLine.es' while time stamping 1) Dummy object 
(EndFlash) OnsetTime; 2) Start of Inline code execution; 3) Start of 
vertical retrace where the canvas is drawn to screen:

1)EndFlash.OnsetTime: 5195
2)      stamp_1: 5196
3)      stamp_2: 5212

This is from a laptop, 2.8gHz, 768mb RAM, 60Hz refresh. The stimuli is 
drawn to screen on a refresh starting 17ms (1 refresh @ 60Hz) after dummy 
object's input masks have begun waiting. If the stimuli are drawn near 
centre of the screen there is a further 7 to 11 ms before the display is 
available to a subject. So @ 60Hz there is a possibility of ~25ms 
desynchrony between 'marking' stimulus onset and stimulus availability.

We have timed execution across a number of paradigms using a dummy object 
and the canvas object. For each paradigm the delay is consistent across 
trials. In the example above this might 'only' be 25ms, and a constant, so 
not too much problem for adjusting RTs collected by the dummy object (if 
you want absolute RTs). However, it still represents an essentially 
inaccurate (in terms of ms timing) response collection routine, and to the 
code naive researcher this could lead to problems when it comes to 
synchronising event presentation and the marking of those events by sending 
trigger codes to external equipment such as an EEG system.

It is standard procedure to record both RTs and EEG epochs from the same 
time - stimulus onset. So it is tempting to use the Object.OnsetSignalPort 
method to send a TTL pulse at the time RT is measured from. These pulses 
need to be held high for a period. For example, Neuroscan recommend 10ms 
minimum, and we had some analysis software that liked 200ms pulses. The 
code keeping the pulse high is immediately after the dummy object and while 
it is running nothing else proceeds. Using a 10ms pulse the dummy object - 
display available delay in one of our paradigms ballons from 20ms to 38ms 
(+ 1 missed refresh), a considerable time in EEG research. Forget about 
200ms pulses.

When using canvas we continue to collect RTs using a dummy object, but we 
time stamp our code and send TTL pulses when screen drawing code has 
finished, halfway (stamp_3, below) through the refresh where the screen is 
drawn. Keeping the pulse high then has no impact on timing of critical 
events. We adjust RT: RT = RT - (stamp_3 - Object.OnsetTime).

                 Object.OnsetTime: 33808 - open input masks
                 stamp_1: 33809               - begin Inline ... prepare 
stuff, wait for vertical retrace
                 stamp_2: 33820               - begin vertical retrace; 
begin execution screen draw code
                 stamp_3: 33828               - finish execution screen 
draw code; send TTL pulse
                 stamp_4: 33828               - finish execution TTL pulse 
code; keep high for 10ms
                 stamp_5: 33838               - pull pins low

I know very little about input masks, but e-prime advise against writing 
your own. It would be nice if the canvas object came with the capacity to 
designate a section of code, say following a screen refresh, as an object 
in its own right with built in input masks.

Does anybody write their own input masks?

Peter



Peter Quain
School of Psychology
University of New England
Armidale, Australia, 2351
Phone:  02 6773 5193
Fax:      02 6773 3820



More information about the Eprime mailing list