Programming Reference:BCI2000FileReader Class
The BCI2000FileReader class provides an interface to data stored in a single BCI2000 data file.
Methods
BCI2000FileReader([file name])
With a file name given as an argument, the constructor will try to open the specified file.
Open(file name)
Will open the specified data file. Use the IsOpen and ErrorState properties to check whether a file is actually open.
RawValue(channel, sample)
Sets the current sample position to the value specified in the second argument, and returns the raw sample value for the channel specified in the first argument.
CalibratedValue(channel, sample)
Sets the current sample position to the value specified in the second argument, and returns the calibrated sample value for the channel specified in the first argument. The calibrated sample value is obtained by applying channel-specific sample offsets and gains as present in the file's SourceChOffsets and SourceChGains parameters.
ReadStateVector(sample)
Set the current sample position to the specified value, and reads state vector data.
Properties
IsOpen (r)
true when a file has been opened successfully, false otherwise.
ErrorState (r)
One of
- NoError,
- FileOpenError,
- MalformedHeader.
NumSamples (r)
The number of samples in the currently opened data file.
SamplingRate (r)
The currently opened data file's sampling rate.
SignalProperties (r)
A SignalProperties object describing the current file's data format, number of channels, sample block size (in its Elements property), and physical units.
FileFormatVersion (r)
A string describing the file's format as specified by the file header. Currently, this is "1.0" or "1.1".
HeaderLength (r)
The data file's header length in bytes.
StateVectorLength (r)
The state vector's length in bytes.
Parameters (r)
A parameter list object that contains all parameters present in the file.
Parameter (r)
Access to an individual parameter, following the syntax provided by the Environment class.
States (r)
A state list object containing all state variables present in the file.
State (r)
Access to an individual state variable, following the syntax provided by the Environment class. The returned value will match the state variable's value at the current sample position, as specified by one the RawValue, CalibratedValue, or ReadStateVector methods.
StateVector (r)
Access to the full state vector, with state values matching those at the current sample position.