Difference between revisions of "Event File Format"

From BESA® Wiki
Jump to: navigation, search
(Initial creation of article)
 
(added info)
Line 6: Line 6:
 
=== File Header ===
 
=== 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 last n data elements can be omitted, if they are neither Code nor one of ''Tms'', ''Tmu'' or ''Tsec''. The following codes are recognized by the ERP module:
 
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 last n data elements can be omitted, if they are neither Code nor one of ''Tms'', ''Tmu'' or ''Tsec''. The following codes are recognized by the ERP module:
* Code - event code (integer, see section Event Codes)
+
* Code - event code (integer, see section [[#Event Codes|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)
 
* 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)
 
* TriNo - trigger number (integer) (identifies the trigger in the event bar of the main module)
Line 65: Line 65:
  
 
=== Additional Event Information ===
 
=== 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]]) for an example.
 +
An "Average Segment" includes the prestimulus baseline interval in microseconds. This is defined in the ''TriNo'' column of the event file.
  
 
=== Requirements ===
 
=== Requirements ===
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 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,  
+
The file is invalid, if
if there are ambiguities in the header  
+
• there are ambiguities in the header  
if there is a data type mismatch in the data line  
+
• there is a data type mismatch in the data line  
if an event time specifies an event which happened later than the end of the acquisition
+
• 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.
 
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.
+
A line with an invalid or unknown event code ''Code'' is skipped.
  
 
=== Examples ===
 
=== Examples ===
 
Here are four typical examples:
 
Here are four typical examples:

Revision as of 13:18, 8 April 2016

An event file (extension *.evt) 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 last n data elements can be omitted, if they are neither Code nor one of Tms, Tmu or Tsec. 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 below) for an example. An "Average Segment" includes the prestimulus baseline interval in microseconds. This is defined in the TriNo column of the event file.

Requirements

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.

Examples

Here are four typical examples: