Jump to content

User Reference:EDFFileWriter

From BCI2000 Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Function

The EDFFileWriter component writes out data in the EDF File Format.

Parameters

Common Data Storage Parameters

These are storage parameters common to all Data File Formats.

DataDirectory

Path to an existing directory. Recorded data will be stored below that directory. The path may be absolute, or relative to the source module's working directory at startup. Usually, the working directory at startup matches the source module's executable location in the prog directory.

DataFile

The path to the data file relative to the directory, including the file name.

The DataFile parameter is a string that may contain references to other parameters in the form ${Parameter}. By default, it contains a session directory, named according to the ${SubjectSession} parameter, and a file name containing the ${SubjectRun} parameter along with the session number, and a date.

Date variables: The user can introduce date and/or time into the file name. One may enter ${DateTime:<format string>} to add date and/or time in an arbitrary format. <format string> must be a date-time format string as defined for the POSIX strftime() function. For example, ${DateTime:%F} will produce the date in the standard format YYYY-MM-DD. Be careful with time formats which will typically contain the : character, which is illegal in Windows file names. To produce both date and time, use ${DateTime:%F-%H-%M-%S}.

NOTE: When the file name contains both a run number, and a date/time string, auto-incrementing the run number will not work properly. Auto-incrementing the run number depends on all other components of the file name being constant, which is not the case for date and time.

SubjectName

A textual ID for the subject. This text may appear in session directories, and data file names.

SubjectSession

A textual ID for the current session. Sessions correspond to data directories. By default, the path of a session directory is constructed according to

${DataDirectory}/${SubjectName}${SubjectSession}

SubjectRun

A number indicating the current run. Runs correspond to data files. To avoid accidental loss of data, run numbers are auto-incremented to the largest unused value. Within a session directory, data file names are by default constructed according to

${SubjectName}S${SubjectSession}R${SubjectRun}.${FileFormat}

By default, a data file's extension depends on its File Format.

ID_System, ID_Amp, ID_Montage

These parameters are provided for documentation purposes and may contain arbitrary text.

FileSplittingCondition

While recording, recorded files may be split into multiple files with part2, part3, ... partN appended to the file name (before the extension). The first file will not be renamed to part1, though. When a condition is entered into the FileSplittingCondition parameter, it will be evaluated after each block of data has been written. Each time the condition is fulfilled, the old file will be closed, and a new one will be opened. Each partial file will be a valid file in the chosen FileWriter's format in its own right; only file names will carry information about how files should be combined to result in the full run file.

Conditions are simple strings representing either

  • a temporal duration, e.g. 00:00:30 for a duration of 30 seconds, or
  • a file size, e.g. 1.5MB for a size of 1.5 megabytes. Units of kB, MB, GB, TB and kiB, MiB, GiB, and TiB are supported. Prefixes without the i will refer to powers of 1000, whereas prefixes with an i refer to powers of 1024.

By default, the FileSplittingCondition parameter is empty, i.e. no file splitting occurs.

PrimaryOutputChannels

List of channels stored into the primary output file (see SecondaryOutputFiles below). Channel names may contain * and ? wildcards, and character ranges enclosed in []; wildcard patterns may be negated by prepending an exclamation mark. Ranges of channels may be specified using : or - to separate begin from end.

By default, this is set to "*", indicating that all channels should be recorded.

Examples:

1-8         // the first 8 channels
1-8 !4      // the first 8 channels except the 4th
EEG*        // wildcard pattern that matches all channels beginnning with "EEG"
MCQ01-MCQ23 // range of channels by name

SecondaryOutputFiles

A matrix where each row corresponds to a secondary output file. Columns are:

name

A string that identifies the output file. When constructing a file name, that string is appended to the run's base name. Example: When "name" is "EEG", and the primary output file's name is "Wilbur001Run02.dat", then the secondary file name will be "Wilbur001R02.EEG.dat".

prefix

A string that is prepended to the output file name, separated with a dot. This may be used alternatively, or in conjunction with "name". The combination of "prefix" and "name" must uniquely identify the output file.

channels

A channel list as described for PrimaryOutputChannels above.

decimation

An optional integer decimation factor used to downsample the secondary output file's data. Before downsampling, a 3rd order IIR filter is applied to avoid aliasing artifacts. Note that the decimation factor must also be a divisor of the sample block size.

SavePrmFile

Determines whether a BCI2000 parameter file is saved along with the EDF file. As EDF cannot represent BCI2000 parameters, parameter information is lost if SavePrmFile is switched off. This parameter is optional, and will not appear in the parameter configuration dialog by default. To use it, specify --SavePrmFile=1 on the command line when starting up the source module.

EDFFileWriter Specific Parameters

SubjectYearOfBirth

Year the subject was born, in YYYY format.

SubjectSex

An enumerated value specifying the subject's sex:

  • 0: not specified,
  • 1: male,
  • 2: female.

TransducerType

A string describing the transducer (sensor) type, e.g. EEG: Ag/AgCl.

SignalUnit

A string specifying the physical unit of the calibrated signal. Differently from the notation used throughout the rest of BCI2000, this is usually "uV" rather than "muV".

EquipmentID

A string identifying the equipment provider.

LabID

A string identifying the recording laboratory.

TechnicianID

A string identifying the recording technician.

States

None.

See also

User Reference:DataIOFilter, User Reference:Data File Formats