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< BrainVisionMarkergetMarkers () const
 Return all parsed markers from the .vmrk file.
QVector< BrainVisionChannelInfogetChannelInfos () 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)

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 117 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 124 of file bids_brain_vision_reader.cpp.

◆ ~BrainVisionReader()

BrainVisionReader::~BrainVisionReader ( )
override

Definition at line 130 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").

Implements BIDSLIB::AbstractFormatReader.

Definition at line 567 of file bids_brain_vision_reader.cpp.

◆ getChannelCount()

int BrainVisionReader::getChannelCount ( ) const
overridevirtual

Return the number of measurement channels.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 542 of file bids_brain_vision_reader.cpp.

◆ getChannelInfos()

QVector< BrainVisionChannelInfo > BrainVisionReader::getChannelInfos ( ) const

Return all channel infos.

Definition at line 589 of file bids_brain_vision_reader.cpp.

◆ getFrequency()

float BrainVisionReader::getFrequency ( ) const
overridevirtual

Return the sampling frequency in Hz.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 535 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 413 of file bids_brain_vision_reader.cpp.

◆ getMarkers()

QVector< BrainVisionMarker > BrainVisionReader::getMarkers ( ) const

Return all parsed markers from the .vmrk file.

Definition at line 582 of file bids_brain_vision_reader.cpp.

◆ getSampleCount()

long BrainVisionReader::getSampleCount ( ) const
overridevirtual

Return total number of samples across the recording.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 528 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 139 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 430 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 574 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 549 of file bids_brain_vision_reader.cpp.

◆ unitScale()

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

Definition at line 397 of file bids_brain_vision_reader.cpp.


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