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 ()
 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< EDFChannelInfo > getAllChannelInfos () const
 Return all channel infos (measurement + extra).
QVector< EDFChannelInfo > getMeasurementChannelInfos () 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.

EDF stores data as 16-bit (BDF: 24-bit) little-endian integers in fixed-duration "data records", with channels interleaved within each record.

Definition at line 96 of file bids_edf_reader.h.

Inheritance diagram for BIDSLIB::EDFReader:
Inheritance graph

Constructor & Destructor Documentation

◆ EDFReader()

EDFReader::EDFReader ( )

EDFReader Default constructor.

Definition at line 115 of file bids_edf_reader.cpp.

◆ ~EDFReader()

EDFReader::~EDFReader ( )
override

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

Returns
Human-readable format name.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 408 of file bids_edf_reader.cpp.

◆ getAllChannelInfos()

QVector< EDFChannelInfo > EDFReader::getAllChannelInfos ( ) const

Return all channel infos (measurement + extra).

Returns
Infos for every signal in the EDF header, including annotation/extra channels.

Definition at line 423 of file bids_edf_reader.cpp.

◆ getChannelCount()

int EDFReader::getChannelCount ( ) const
overridevirtual

Return the number of measurement channels.

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

Implements BIDSLIB::AbstractFormatReader.

Definition at line 383 of file bids_edf_reader.cpp.

◆ getFrequency()

float EDFReader::getFrequency ( ) const
overridevirtual

Return the sampling frequency in Hz.

Returns
Sampling frequency in Hz.

Implements BIDSLIB::AbstractFormatReader.

Definition at line 373 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 247 of file bids_edf_reader.cpp.

◆ getMeasurementChannelInfos()

QVector< EDFChannelInfo > EDFReader::getMeasurementChannelInfos ( ) const

Return measurement channel infos only.

Returns
Infos for the measurement channels only, in channel order.

Definition at line 430 of file bids_edf_reader.cpp.

◆ getSampleCount()

long EDFReader::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 363 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 130 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 264 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 415 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 390 of file bids_edf_reader.cpp.


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