BrainVisionReader
Namespace: BIDSLIB · Library: BIDS Library
#include <bids/bids_brain_vision_reader.h>
class BIDSLIB::BrainVisionReader
The BrainVisionReader reads BrainVision file triplets (.vhdr/.vmrk/.eeg) and exposes them through the AbstractFormatReader interface.
BrainVision is the most common format for iEEG (sEEG/ECoG) recordings in BIDS datasets. The format stores data as little-endian binary (INT_16, INT_32, or IEEE_FLOAT_32), either MULTIPLEXED (channels interleaved per time point) or VECTORIZED (channels contiguous).
Inheritance
Public Methods
BrainVisionReader()
Default constructor.
~BrainVisionReader()
open(sFilePath)
Open and parse the file header.
Must be called before reading data.
Parameters:
- sFilePath : const QString & Absolute path to the primary data file.
Returns:
- bool — True if the file was opened and parsed successfully.
getInfo()
Return measurement metadata as FiffInfo.
Returns:
- FiffInfo — FiffInfo populated from the native format header.
readRawSegment(iStartSampleIdx, iEndSampleIdx)
Read a segment of raw data.
Parameters:
-
iStartSampleIdx : int First sample index (0-based, inclusive).
-
iEndSampleIdx : int Last sample index (0-based, exclusive).
Returns:
- Eigen::MatrixXf — Matrix of shape (n_channels x n_samples) with calibrated physical values.
getSampleCount()
Return total number of samples across the recording.
getFrequency()
Return the sampling frequency in Hz.
getChannelCount()
Return the number of measurement channels.
toFiffRawData()
Convert the entire dataset to a FiffRawData structure.
Returns:
- FIFFLIB::FiffRawData — FiffRawData populated with info, calibrations, and sample bounds.
formatName()
Return a descriptive name for the format (e.g.
"EDF", "BrainVision").
supportsExtension(sExtension)
Check whether this reader can handle the given file extension.
Parameters:
- sExtension : const QString & File extension including dot (e.g. ".edf", ".vhdr").
Returns:
- bool — True if this reader supports the extension.
getMarkers()
Return all parsed markers from the .vmrk file.
getChannelInfos()
Return all channel infos.
Static Methods
unitScale(sUnit)
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>