Using_E-Prime - Meg Wiki

Revision 11 as of 2010-10-28 13:09:50

Clear message
location: Using_E-Prime

Using E-Prime for your experiments

In the MEG lab we strongly encourage the use of E-Prime for all experiments. This is not because E-Prime is the best stimulus presentation package, because it probably isn't, but because it has good timing and we like everybody to use the same software. This will prevent us having to install countless packages on the stimulus presentation machine, and also has the additional advantage that there are many other people at the unit with E-Prime knowledge, forming a useful pool of experts.

Basic rules when using E-Prime

The first rule when starting to use E-Prime is to resist copying other peoples scripts. You can do this when your experiment is virtually identical to someone else's, but in all other cases this is both a recipe for disaster and a seriously missed opportunity to learn a new skill.

The second rule is to keep things simple. Never do someting in E-Prime if it can be done outside of it. E-Prime is excellent as a trial builder and an experiment runner, but not very good at anything else.

For critical timing the 'SignalData' mechanism should be used. This will only send a trigger when a stimulus is actually presented, even if there was a delay in the presentation.

Use of sequence files

The best example of simplicity is the use of sequence files. E-Prime encourages you to create your item collection within the E-Studio environment. It offers Excel-like functionality for this, including the option to copy data straight from/to Excel. It is tempting to use this, but I would recommend against it in all but the most simple cases. The main problem arises when you need more than one set of stimuli in your experiment. It is possible to have more than one list of stimuli in an E-Prime script, it's not even very complicated, but I would recommend to design the script to use a single list, and read the items in from a file. That way your script is as simple as it can be, and you have the maximum flexibility too. You can the use the Mix program to generate your item orders for each individual subject or experimental block. The following bit of inline code will read in a list of stimuli:

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
'       InLine Object to open a file and load it into List1
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim listfilename as string

Mouse.ShowCursor True
        
listfilename$ = OpenFileName$("Open list file", "Text Files: *.TXT")

Mouse.ShowCursor False

If listfilename$ <> "" Then
        List1.LoadMethod = ebLoadMethodFile
        List1.Filename = listfilename$
        List1.Load

        List1.Reset
        
        Set List1.TerminateCondition = Cycles(1)
        Set List1.ResetCondition = Samples(List1.Deletion.Count)
else
        MsgBox("Incorrect list file chosen")
End If

Input and Output

We use parallel ports to send triggers from E-Prime to the MEG/EEG machine and to receive signals from button boxes and pulses from the MRI machine. It is also possible to use the PIO card for this, but E-Prime doesn't support the PIO card. You can still use it by using the ScannerSync library, but this will also mean that you will have to do most of the timing by hand. Unless you are an experienced E-Prime programmer it is not recommended to use the ScannerSync library, and just use the parallel port instead.