38#ifndef BIDS_EDF_READER_H
39#define BIDS_EDF_READER_H
101 explicit EDFReader(
float fScaleFactor = 1e6);
106 bool open(
const QString& sFilePath)
override;
108 Eigen::MatrixXf
readRawSegment(
int iStartSampleIdx,
int iEndSampleIdx)
const override;
130 enum EDFHeaderFieldLengths {
132 LOCAL_PATIENT_INFO = 80,
133 LOCAL_RECORD_INFO = 80,
136 NUM_BYTES_HEADER = 8,
137 HEADER_RESERVED = 44,
138 NUM_DATA_RECORDS = 8,
139 DURATION_DATA_RECS = 8,
148 SIG_PREFILTERING = 80,
153 void parseHeader(QIODevice* pDev);
155 float m_fScaleFactor;
159 QString m_sVersionNo;
160 QString m_sPatientId;
161 QString m_sRecordingId;
162 QDateTime m_startDateTime;
163 int m_iNumBytesInHeader{0};
164 int m_iNumDataRecords{0};
165 float m_fDataRecordsDuration{0.0f};
166 int m_iNumChannels{0};
167 int m_iNumBytesPerDataRecord{0};
169 QVector<EDFChannelInfo> m_vAllChannels;
170 QVector<EDFChannelInfo> m_vMeasChannels;
172 mutable QFile m_file;
173 bool m_bIsOpen{
false};
Contains the declaration of the AbstractFormatReader class.
#define BIDSSHARED_EXPORT
BIDS dataset reading, writing, path construction, and sidecar metadata handling for iEEG/EEG/MEG.
AbstractFormatReader()=default
Channel-level metadata from the EDF header.
QString physicalDimension
FIFFLIB::FiffInfo getInfo() const override
Return measurement metadata as FiffInfo.
EDFReader(float fScaleFactor=1e6)
EDFReader Default constructor.
Eigen::MatrixXf readRawSegment(int iStartSampleIdx, int iEndSampleIdx) const override
Read a segment of raw data.
bool open(const QString &sFilePath) override
Open and parse the file header. Must be called before reading data.
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).
float getFrequency() const override
Return the sampling frequency in Hz.
FIFFLIB::FiffRawData toFiffRawData() const override
Convert the entire dataset to a FiffRawData structure.
QVector< EDFChannelInfo > getMeasurementChannelInfos() const
Return measurement channel infos only.
long getSampleCount() const override
Return total number of samples across the recording.
QString formatName() const override
Return a descriptive name for the format (e.g. "EDF", "BrainVision").
int getChannelCount() const override
Return the number of measurement channels.
FIFF measurement file information.
FIFF raw measurement data.