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.
The EDF specification stores data as 16-bit little-endian integers in fixed-duration "data records", with channels interleaved within each record.
Inheritance
Public Methods
EDFReader(fScaleFactor)
EDFReader Default constructor.
Parameters:
- fScaleFactor : float Raw value scaling factor (default: 1e6 for uV→V conversion).
~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.
getFrequency()
Return the sampling frequency in Hz.
getChannelCount()
Return the number of measurement channels.
toFiffRawData()
Convert the entire dataset to a FiffRawData structure.
Returns:
- FIFFLIB::FiffRawData — FiffRawData populated with info, calibrations, and sample bounds.
formatName()
Return a descriptive name for the format (e.g.
"EDF", "BrainVision").
supportsExtension(sExtension)
Check whether this reader can handle the given file extension.
Parameters:
- sExtension : const QString & File extension including dot (e.g. ".edf", ".vhdr").
Returns:
- bool — True if this reader supports the extension.
getAllChannelInfos()
Return all channel infos (measurement + extra).
getMeasurementChannelInfos()
Return measurement channel infos only.
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>