Triggers - Meg Wiki

Revision 15 as of 2007-05-18 10:49:16

Clear message
location: Triggers

About Triggers

In fMRI the scanner paces the experiment, and your experimental software will have to catch scanner pulses and sync the trials to them. In MEG the recording is basically continuous, so to know when a trial happened, and what was actually presented, you will have to send triggers to be recorded with the brain signals. These triggers will be used as the basis for averaging your trials later, or even online if you want.

Triggers can be send through the PIO card or the parallel port. E-Prime can only use the parallel port, DMDX only the PIO card. On the parallel port 8 channels are available for sending triggers, allowing a total of 255 different trigger values to be send. If you need more, you will need to send several triggers in each trial. In addition, 5 channels are available for responses. The PIO card has a total of 24 channels, which can all be configured to be either input or output in banks of 8 channels.

There's a box on the table, next to the stimulus computer, to which the trigger pulses have to be send. Two other boxes are connected to the parallel port and the PIO card. The appropriate connections can be made with BNC patch cables.

ImageLink(EN_stim_box.png, //MegCbu, height=400)

The EN trigger box is connected to an identical box that lives in the stimulus cabinet, which is a metal cabinet that has a connection to the inside of the MSR (Magnetically Shielded Room). Equipment that needs to be fed into the MSR, like button boxes, needs to be placed in the stimulus cabinet. It can than be connected to the trigger box inside the cabinet.

The two boxes, in the cabinet and on the table, will nomally work in 'mirrored mode', which means that everything that happens on one box will be mirrored on the other. In that way a button box can be connected to the stimulus computer via these two boxes.

ImageLink(EN_stim_cabinet.png, //MegCbu, height=500)

You will have to be careful, though, as these two boxes can also be used in independent mode. The mode is switched by selecting a different channel in the channel selection dialog of the Neuromag acquisition software. The EN manual has this entry on the issue:

The electric interface of the trigger signals is called a Remote Trigger Unit, which is connected to the System Control Card (SCC) housed in the data acquisition system cabinet. Elekta Neuromag systems include two Remote Trigger Units, which by default operate in parallel, i.e. input #1 and output #1 on both Remote Trigger Units refer to trigger line #1 on the trigger channel (STI101) associated with the 1st interface unit, however, the two interfaces can be treated separately by turning on (selecting for acquisition) also the trigger channel (STI102) associated with the 2nd interface unit.

E-Prime and Trigger Timing

Much has been written on the topic of accurate timing using E-Prime. There are several ways to send a trigger signal from the stimulation (STIM) computer to the MEG acquisition computer, but some of these will produce unpredictable timing errors under certain circumstances (e.g., using inline code & pre-release time together). I strongly recommend [http://www.pstnet.com/e-prime/support/kb.asp?TopicID=1318 this page] on the E-Prime support site.

Timing seems to work well with the 'OnsetSignalEnabled' method. The basic strategy is to insert inline code at the beginning of the experiment telling E-Prime to send a trigger every time it presents a certain object or objects (e.g., 'Target' and 'Blank'). This ensures that the trigger is time-locked to the presentation of the stimulus. [Note that this time-locking is NOT guaranteed if you simply insert an inline 'writeport' command ahead of the object if you are using pre-release time and vertical refresh syncing!] You will generally want to reset the port to 0 by enabling OnsetSignal on the following object with a value of '0' or by inserting inline code with 'writeport' and value 0 after the object. If you want the trigger value to vary with stimulus condition, you can accomplish this using inline code at the beginning of the trial.

Here's an example. Imagine a simple trial structure with a DisplayTarget text object followed by a DisplayBlank text object. We want to send a trigger from STIM to MEG whenever DisplayTarget is presented, and we want the trigger value to reflect the stimulus condition.

At the beginning of the session procedure, insert an inline object containing:

'Enable port signal (value 1 for now) for DisplayTarget:
!DisplayTarget.!OnsetSignalEnabled = True
!DisplayTarget.!OnsetSignalPort = &H378
!DisplayTarget.!OnsetSignalData = 1

'Enable port signal (value 0) for DisplayBlank:
!DisplayBlank.!OnsetSignalEnabled = True
!DisplayBlank.!OnsetSignalPort = &H378
!DisplayBlank.!OnsetSignalData = 0 

At the beginning of the trial procedure, insert an inline object containing:

'Set DisplayTarget port signal value based on condition:
!DisplayTarget.!OnsetSignalData = c.getattrib("!ConditionCode") 

Where 'ConditionCode' is a numeric variable in the range (1:255). This variable can be defined as a column in your List or using inline code. Be sure to add a 'Port' device with address '&h378' using Edit -> Experiment.