User Reference:Data File Formats

From BCI2000 Wiki
Jump to navigation Jump to search

This page describes which data formats are available for output, and how to select amongst them.

General Information

At runtime, selection of a file format is achieved by specifying a command line parameter to the source module, as in

gUSBampSource --FileFormat=Null

or

SignalGenerator --FileFormat=GDF

Typically, source modules are launched from batch files contained in the batch directory, and their command line parameters are specified there.

The value following the last minus character, appended with FileWriter, will be matched against the names of all GenericFileWriter descendants present in the source module. In the first example, the NullFileWriter class will be used for data output (which will not produce any output file), and the GDFFileWriter class will be used in the second example.

Internally, support for various output formats is provided by File Writer classes (pieces of software) implementing the interface defined by the GenericFileWriter class. Thus, a programmer can add support for a new output format by deriving a new class from GenericFileWriter, and adding it to existing source modules.

BCI2000 File Format

--FileFormat=BCI2000

Parameters, BCI2000 state variables, and brain signal data will be written into a BCI2000 data file as defined in the BCI2000 specification. This is also the default if no file format is specified explicitly.

Output in BCI2000 file format is implemented by the BCI2000FileWriter component.

Null File Format

--FileFormat=Null

No information is recorded. Individual filters may still write log files to the directory defined by the DataDirectory, SubjectName, and SubjectSession parameters.

EDF File Format

--FileFormat=EDF

EDF (European Data Format) is a standard for biosignal data especially popular in the area of sleep research.

  • EDF is limited to 16 bit data.
  • BCI2000 state variables will be mapped to additional signal channels.
  • BCI2000 parameters cannot be represented in EDF format. Setting the SaveAdditionalParameterFile parameter to 1 will save a separate BCI2000 parameter file along with the EDF data file.

Output in EDF format is implemented by the EDFFileWriter component.

References

  • Bob Kemp, Alpo Värri, Agostinho C. Rosa, Kim D. Nielsen and John Gade, A simple format for exchange of digitized polygraphic recordings, Electroencephalography and Clinical Neurophysiology, 82 (1992), pp 391-393.
  • EDF home page at http://www.hsr.nl/edf/

GDF File Format

--FileFormat=GDF

GDF is a general data format for biosignals which is popular in BCI research. Building on EDF, GDF allows for arbitrary numeric data types, introduces an event table, and provides standardized encoding of events.

  • Currently, BCI2000 supports Version 2.10 of the GDF format specification.
  • BCI2000 does not prescribe the meaning of its state variables. GDF, on the other hand, associates a fixed set of events with certain numeric codes. Thus, a general mapping of BCI2000 states onto GDF events is not possible. Instead, GDF events are created via a user-defined set of mapping rules in the EventCode parameter, which also has a set of rules predefined for the most important cases.
  • Besides GDF events, BCI2000 state variables will also be mapped to additional signal channels the same way as for EDF.
  • Since version 2.0, GDF provides additional header space for metadata which is organized as a sequence of tag/length/value structures. BCI2000 uses such a structure--tagged with a "BCI2000" tag--to store parameters. Within the GDF data field, the same human readable format is used as it applies to BCI2000 parameter files, i.e. a sequence of parameter definition lines.

Output in GDF file format is implemented by the GDFFileWriter component.

References

See also

User Reference:DataIOFilter, User Reference:Matlab MEX Files#save_bcidat