Event File Format

From BESA® Wiki
Jump to: navigation, search
Module information
Modules BESA Research Basic or higher
Version BESA Research 5.2 or higher


Event files (extension *.evt) contain triggers and events and can be loaded as an additional file to provide more information about the whole course of an EEG/MEG recording. An event file can be edited by opening it in any text editor, e.g. Notepad. It is also possible to create new event files from scratch which can be imported into the data file later. Note the following conventions for event files:

  • Event descriptions are given in the columns of the event file
  • Each file must contain a header line and data lines

File Header

The header is comprised of abbreviated descriptions for each column. Each entry in the data line must be specified in the header line at the correct column position. The order of the data elements and their description in the header line can be chosen arbitrarily and the entries can be separated by commas, tabs and/or spaces. The Code and one of Tms, Tmu or Tsec are obligatory, other data elements can be omitted. The following codes are recognized by the ERP module:

  • Code - event code (integer, see section Event Codes)
  • Tms - event time in milliseconds relative to the start of the data file or Tmu [in microseconds] or Tsec [in sec] (floating point value)
  • TriNo - trigger number (integer) (identifies the trigger in the event bar of the main module)
  • RCode - reaction code (integer)
  • RTms - reaction time in milliseconds or RTmu or RTsec (floating point value)
  • Comnt - comment to describe event (string of up to 39 characters), will be truncated if longer than 39 characters.

You can also define columns which should not be recognized by the ERP module. Simply specify these columns in the header with any unknown code. Therefore you might be able to use previously generated files without major changes.

Event Codes

The event code Code must be one of the following integers:

Code Event/Trigger Type
1 Trigger
2 Comment
3 Marker
11 Pattern1
12 Pattern2
13 Pattern3
14 Pattern4
15 Pattern5
21 Artifact on
22 Artifact off
31 Epoch on
32 Epoch off
41 New segment
42 Average segment

Additional Event Information

The event reaction time, event reaction code and event comment are represented by the comment in the main module as "Comment (Rx,T____)", where Comment is the event comment, x describes the reaction code and the underscored line will be filled with the reaction time. Reaction time and reaction code are only read if the event code specifies it as a trigger. A "New Segment" event can include time information that defines the starting time of the segment. This is defined in the TriNo column of the event file. The format is YYYY-MM-DDTHH:MM:SS, e.g. 2010-04-26T15:30:20.31 (note: seconds are a decimal number). If no time is defined, use a hyphen ('-'). See Examples below. An "Average Segment" includes the prestimulus baseline interval in microseconds. This is defined in the TriNo column of the event file.


The file is valid if the header line contains at least the entries Code and one of Tms, Tmu and Tsec. The header specifications are case insensitive. The file is invalid, if

  • there are ambiguities in the header
  • there is a data type mismatch in the data line
  • an event time specifies an event which happened later than the end of the acquisition

Each omitted data entry is set to 0 or empty string by default. A line with an invalid or unknown event code Code is skipped.


Here are a couple of typical examples:

1) Simple trigger file

Tms Code TriNo Comnt
100.234 1 3 Trigger: 3
2300.456 1 1 Trigger:1
4500.21 1 1 Trigger:1
9800.47 1 7 Trigger:7
12500.78 1 2 Trigger:2
21237 1 1 Trigger:1

This example event file can be downloaded here: Example 1

2) Trigger file with reaction code and reaction time

Tms Code TriNo RTsec RCode
100.234 1 3 0.23 1
2300.456 1 1 1.11 2
4500.21 1 1 0.15 1
9800.47 1 7 0.87 0
12500.78 1 2 2.1 2
21237 1 1 3 1

This example event file can be downloaded here: Example 2

3) Event file without triggers

Tmu Code Comnt
10000.234 3 Marker
230000.456 12
450000.21 14
980000.47 12
1250000.78 3 Marker
2123700 2 Comment
2534100.567 15

This example event file can be downloaded here: Example 3

4) File including triggers and events

Tms Code TriNo RTsec RCode Comnt
100.234 2 0 0 0 CommentSet
2300.456 1 2
4500.21 1 1 0.15 1
9800.47 11
12500.78 3
21237 2 0 3 1 Comment
25341.567 15

This example event file can be downloaded here: Example 4

5) New Segments

Tms Code TriNo Comnt
0 41 2010-04-26T15:30:20.31 Start recording
21000 41 2010-04-27T09:17:00.0 Next day

The new segment at the time 0 overrides the start time in the file. A second segment at 21 s starts a new data block one day later at 9:17.

This example event file can be downloaded here: Example 5

6) Average Segments

Tms Code TriNo Comnt
0 42 100000 Cond 1: 25 avs
1100 42 200000 Cond 2: 201 avs

The file contains two average segments. The first, with a prestimulus interval of 100 ms, has a duration of 1100 ms. The second, with a prestimulus interval of 200 ms, has a length up to the end of the data file.

This example event file can be downloaded here: Example 6