Diff for "EprimeTiming" - MRC CBU Imaging Wiki
location: Diff for "EprimeTiming"
Differences between revisions 5 and 6
Revision 5 as of 2006-08-09 11:43:01
Size: 2985
Editor: devel03
Comment:
Revision 6 as of 2006-08-09 12:35:42
Size: 2970
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Line 7: Line 6:
Line 14: Line 12:
A pre-release value of 100-200 ms is recommended before any event that needs some preparation, like presenting pictures, soundfiles or complicated text, or events that require some logging.  A pre-release value of 100-200 ms is recommended before any event that needs some preparation, like presenting pictures, soundfiles or complicated text, or events that require some logging.
Line 16: Line 14:
The delay before the first event is unavoidable, except by adding an extra event just to take care of this.  The delay before the first event is unavoidable, except by adding an extra event just to take care of this.
Line 19: Line 17:
Line 26: Line 23:
3.Custom mode timing enables you to insert an end time for an event in the E-Prime script.  3.Custom mode timing enables you to insert an end time for an event in the E-Prime script.
Line 31: Line 28:
Line 39: Line 35:
Line 43: Line 38:

Advice on how to use E-Prime in time-critical experiments

E-Prime is very easy to use and can time events with good accuracy, but sadly not with the default settings. If your experiment involves presenting stimuli or getting responses from the subject, and you need this done with ms accuracy, please read the following recommendations.

Using Pre-Release

E-Prime doesn’t prepare any event. It only deals with things as it encounters them. So, playing a soundfile or displaying a large image could introduce significant delays into your script. Pre-Release is designed to prevent this, as it allows the preparation of the next item before the end of the current one.

Pre-Release can be set in the ‘Duration/Input’ input tab of the properties of an object.

attachment:eprime_prerelease.png

A pre-release value of 100-200 ms is recommended before any event that needs some preparation, like presenting pictures, soundfiles or complicated text, or events that require some logging.

The delay before the first event is unavoidable, except by adding an extra event just to take care of this.

Timing Modes

E-Prime knows three timing modes, to enable it to deal with delays.

1.Event timing mode, where the total duration of an event is maintained.

2.Cumulative timing mode, where a delay is compensated for by shortening the duration of a subsequent event.

3.Custom mode timing enables you to insert an end time for an event in the E-Prime script.

attachment:eprime_timing_modes.png

Logging

Logging the actual timing of all events is very important, to make sure that errors do not go unnoticed.

Make sure to log:

  • OnsetTime

  • OnsetDelay

  • Duration Error

Sadly, logging of all scanner pulses isn’t possible

Pre-Loading items in E-Prime

If you want to make sure that your item will start with the minimum amount of delay, a good solution is to pre-load sound files and images. Create an inline object and insert it at the beginning of the trial, well before the actual events.

The code for loading images and sound files is given below. You will need to change the names of the SoundOut and ImageDisplay objects to the ones used in your script, and also the names of the attributes that hold the filenames.

This example shows how to preload soundfiles:

'Retrieve the sound filename from the Context
Dim strSoundFileName As String
strImageFileName = c.GetAttrib("soundfilename")

'Assign the new filename and instruct the object
'to load the image
SoundOut1.Filename = strSoundFileName
SoundOut1.Load

And here’s how to preload images:

'Retrieve the image filename from the Context
Dim strImageFileName As String
strImageFileName = c.GetAttrib("imagefilename")

'Assign the new filename and instruct the object
'to load the image
ImageDisplay1.Filename = strImageFileName
ImageDisplay1.Load

CbuImaging: EprimeTiming (last edited 2013-03-07 21:24:06 by localhost)