v2.0.0
Loading...
Searching...
No Matches
BIDSLIB::BrainVisionReader Class Reference

The BrainVisionReader reads BrainVision file triplets (.vhdr/.vmrk/.eeg) and exposes them through the AbstractFormatReader interface. More...

#include <bids_brain_vision_reader.h>

Public Member Functions

 BrainVisionReader ()
 Default constructor.
 ~BrainVisionReader () override
bool open (const QString &sFilePath) override
 Open and parse the file header. Must be called before reading data.
FIFFLIB::FiffInfo getInfo () const override
 Return measurement metadata as FiffInfo.
Eigen::MatrixXf readRawSegment (int iStartSampleIdx, int iEndSampleIdx) const override
 Read a segment of raw data.
long getSampleCount () const override
 Return total number of samples across the recording.
float getFrequency () const override
 Return the sampling frequency in Hz.
int getChannelCount () const override
 Return the number of measurement channels.
FIFFLIB::FiffRawData toFiffRawData () const override
 Convert the entire dataset to a FiffRawData structure.
QString formatName () const override
 Return a descriptive name for the format (e.g. "EDF", "BrainVision").
bool supportsExtension (const QString &sExtension) const override
 Check whether this reader can handle the given file extension.
QVector< BrainVisionMarker > getMarkers () const
 Return all parsed markers from the .vmrk file.
QVector< BrainVisionChannelInfo > getChannelInfos () const
 Return all channel infos.
Public Member Functions inherited from BIDSLIB::AbstractFormatReader
virtual ~AbstractFormatReader ()=default
 Virtual destructor.

Static Public Member Functions

static float unitScale (const QString &sUnit)
static bool isVoltageUnit (const QString &sUnit)

Additional Inherited Members

Public Types inherited from BIDSLIB::AbstractFormatReader
using UPtr = std::unique_ptr<AbstractFormatReader>
Protected Member Functions inherited from BIDSLIB::AbstractFormatReader
 AbstractFormatReader ()=default

Detailed Description

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).

Definition at line 125 of file bids_brain_vision_reader.h.

Inheritance diagram for BIDSLIB::BrainVisionReader:
Inheritance graph

Constructor & Destructor Documentation

◆ BrainVisionReader()

BrainVisionReader::BrainVisionReader ( )

Default constructor.

Definition at line 97 of file bids_brain_vision_reader.cpp.

◆ ~BrainVisionReader()

BrainVisionReader::~BrainVisionReader ( )
override

Definition at line 103 of file bids_brain_vision_reader.cpp.

Member Function Documentation

◆ formatName()

QString BrainVisionReader::formatName ( ) const
overridevirtual

Return a descriptive name for the format (e.g. "EDF", "BrainVision").

Returns
Human-readable format name.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 564 of file bids_brain_vision_reader.cpp.

◆ getChannelCount()

int BrainVisionReader::getChannelCount ( ) const
overridevirtual

Return the number of measurement channels.

Returns
Number of measurement channels (rows returned by readRawSegment).

Implements BIDSLIB::AbstractFormatReader.

Definition at line 539 of file bids_brain_vision_reader.cpp.

◆ getChannelInfos()

QVector< BrainVisionChannelInfo > BrainVisionReader::getChannelInfos ( ) const

Return all channel infos.

Returns
Channel infos parsed from the .vhdr header, in channel order.

Definition at line 586 of file bids_brain_vision_reader.cpp.

◆ getFrequency()

float BrainVisionReader::getFrequency ( ) const
overridevirtual

Return the sampling frequency in Hz.

Returns
Sampling frequency in Hz.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 532 of file bids_brain_vision_reader.cpp.

◆ getInfo()

FIFFLIB::FiffInfo BrainVisionReader::getInfo ( ) const
overridevirtual

Return measurement metadata as FiffInfo.

Returns
FiffInfo populated from the native format header.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 404 of file bids_brain_vision_reader.cpp.

◆ getMarkers()

QVector< BrainVisionMarker > BrainVisionReader::getMarkers ( ) const

Return all parsed markers from the .vmrk file.

Returns
Markers in file order; empty if no marker file was parsed.

Definition at line 579 of file bids_brain_vision_reader.cpp.

◆ getSampleCount()

long BrainVisionReader::getSampleCount ( ) const
overridevirtual

Return total number of samples across the recording.

Returns
Number of samples per channel in the whole recording.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 525 of file bids_brain_vision_reader.cpp.

◆ isVoltageUnit()

bool BrainVisionReader::isVoltageUnit ( const QString & sUnit)
static

Definition at line 397 of file bids_brain_vision_reader.cpp.

◆ open()

bool BrainVisionReader::open ( const QString & sFilePath)
overridevirtual

Open and parse the file header. Must be called before reading data.

Parameters
[in]sFilePathAbsolute path to the primary data file.
Returns
True if the file was opened and parsed successfully.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 112 of file bids_brain_vision_reader.cpp.

◆ readRawSegment()

Eigen::MatrixXf BrainVisionReader::readRawSegment ( int iStartSampleIdx,
int iEndSampleIdx ) const
overridevirtual

Read a segment of raw data.

Parameters
[in]iStartSampleIdxFirst sample index (0-based, inclusive).
[in]iEndSampleIdxLast sample index (0-based, exclusive).
Returns
Matrix of shape (n_channels x n_samples) with calibrated physical values.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 421 of file bids_brain_vision_reader.cpp.

◆ supportsExtension()

bool BrainVisionReader::supportsExtension ( const QString & sExtension) const
overridevirtual

Check whether this reader can handle the given file extension.

Parameters
[in]sExtensionFile extension including dot (e.g. ".edf", ".vhdr").
Returns
True if this reader supports the extension.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 571 of file bids_brain_vision_reader.cpp.

◆ toFiffRawData()

FiffRawData BrainVisionReader::toFiffRawData ( ) const
overridevirtual

Convert the entire dataset to a FiffRawData structure.

Returns
FiffRawData populated with info, calibrations, and sample bounds.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 546 of file bids_brain_vision_reader.cpp.

◆ unitScale()

float BrainVisionReader::unitScale ( const QString & sUnit)
static

Definition at line 383 of file bids_brain_vision_reader.cpp.


The documentation for this class was generated from the following files: