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

The EDFReader reads European Data Format (EDF/EDF+) files and exposes them through the AbstractFormatReader interface. More...

#include <bids_edf_reader.h>

Public Member Functions

 EDFReader (float fScaleFactor=1e6)
 EDFReader Default constructor.
 ~EDFReader () 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< EDFChannelInfogetAllChannelInfos () const
 Return all channel infos (measurement + extra).
QVector< EDFChannelInfogetMeasurementChannelInfos () const
 Return measurement channel infos only.
Public Member Functions inherited from BIDSLIB::AbstractFormatReader
virtual ~AbstractFormatReader ()=default
 Virtual destructor.

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 EDFReader reads European Data Format (EDF/EDF+) files and exposes them through the AbstractFormatReader interface.

The EDF specification stores data as 16-bit little-endian integers in fixed-duration "data records", with channels interleaved within each record.

Definition at line 93 of file bids_edf_reader.h.

Inheritance diagram for BIDSLIB::EDFReader:
Inheritance graph

Constructor & Destructor Documentation

◆ EDFReader()

EDFReader::EDFReader ( float fScaleFactor = 1e6)
explicit

EDFReader Default constructor.

Parameters
[in]fScaleFactorRaw value scaling factor (default: 1e6 for uV→V conversion).

Definition at line 120 of file bids_edf_reader.cpp.

◆ ~EDFReader()

EDFReader::~EDFReader ( )
override

Definition at line 127 of file bids_edf_reader.cpp.

Member Function Documentation

◆ formatName()

QString EDFReader::formatName ( ) const
overridevirtual

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

Implements BIDSLIB::AbstractFormatReader.

Definition at line 406 of file bids_edf_reader.cpp.

◆ getAllChannelInfos()

QVector< EDFChannelInfo > EDFReader::getAllChannelInfos ( ) const

Return all channel infos (measurement + extra).

Definition at line 421 of file bids_edf_reader.cpp.

◆ getChannelCount()

int EDFReader::getChannelCount ( ) const
overridevirtual

Return the number of measurement channels.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 381 of file bids_edf_reader.cpp.

◆ getFrequency()

float EDFReader::getFrequency ( ) const
overridevirtual

Return the sampling frequency in Hz.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 371 of file bids_edf_reader.cpp.

◆ getInfo()

FiffInfo EDFReader::getInfo ( ) const
overridevirtual

Return measurement metadata as FiffInfo.

Returns
FiffInfo populated from the native format header.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 251 of file bids_edf_reader.cpp.

◆ getMeasurementChannelInfos()

QVector< EDFChannelInfo > EDFReader::getMeasurementChannelInfos ( ) const

Return measurement channel infos only.

Definition at line 428 of file bids_edf_reader.cpp.

◆ getSampleCount()

long EDFReader::getSampleCount ( ) const
overridevirtual

Return total number of samples across the recording.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 361 of file bids_edf_reader.cpp.

◆ open()

bool EDFReader::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 136 of file bids_edf_reader.cpp.

◆ readRawSegment()

MatrixXf EDFReader::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 268 of file bids_edf_reader.cpp.

◆ supportsExtension()

bool EDFReader::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 413 of file bids_edf_reader.cpp.

◆ toFiffRawData()

FiffRawData EDFReader::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 388 of file bids_edf_reader.cpp.


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