EDFReader
Namespace: BIDSLIB · Library: BIDS Library
#include <bids/bids_edf_reader.h>
class BIDSLIB::EDFReader
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.
src/examples/ex_bids/main.cpp
std::unique_ptr<AbstractFormatReader> edf = BidsRawData::createReader(".edf"); // or construct EDFReader directly
const bool edfOpen = edf->open(BIDSPath(root, "02", "01", "rest", "eeg", "eeg", ".edf").filePath());
const FIFFLIB::FiffInfo edfInfo = edf->getInfo();
const MatrixXf edfHead = edf->readRawSegment(0, 201);
Inheritance
Public Methods
EDFReader()
EDFReader Default constructor.
~EDFReader()
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.
Returns:
- long — Number of samples per channel in the whole recording.