v2.0.0
Loading...
Searching...
No Matches
bids_abstract_format_reader.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef BIDS_ABSTRACT_FORMAT_READER_H
36#define BIDS_ABSTRACT_FORMAT_READER_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "../bids_global.h"
43
44#include <fiff/fiff_info.h>
45#include <fiff/fiff_raw_data.h>
46
47//=============================================================================================================
48// EIGEN INCLUDES
49//=============================================================================================================
50
51#include <Eigen/Core>
52
53//=============================================================================================================
54// QT INCLUDES
55//=============================================================================================================
56
57#include <QString>
58#include <memory>
59
60//=============================================================================================================
61// DEFINE NAMESPACE BIDSLIB
62//=============================================================================================================
63
64namespace BIDSLIB
65{
66
67//=============================================================================================================
75{
76public:
77 using UPtr = std::unique_ptr<AbstractFormatReader>;
78
79 //=========================================================================================================
83 virtual ~AbstractFormatReader() = default;
84
85 //=========================================================================================================
93 virtual bool open(const QString& sFilePath) = 0;
94
95 //=========================================================================================================
101 virtual FIFFLIB::FiffInfo getInfo() const = 0;
102
103 //=========================================================================================================
112 virtual Eigen::MatrixXf readRawSegment(int iStartSampleIdx, int iEndSampleIdx) const = 0;
113
114 //=========================================================================================================
118 virtual long getSampleCount() const = 0;
119
120 //=========================================================================================================
124 virtual float getFrequency() const = 0;
125
126 //=========================================================================================================
130 virtual int getChannelCount() const = 0;
131
132 //=========================================================================================================
139
140 //=========================================================================================================
144 virtual QString formatName() const = 0;
145
146 //=========================================================================================================
154 virtual bool supportsExtension(const QString& sExtension) const = 0;
155
156protected:
158};
159
160} // namespace BIDSLIB
161
162#endif // BIDS_ABSTRACT_FORMAT_READER_H
FiffInfo class declaration.
FiffRawData class declaration.
bids library export/import macros.
#define BIDSSHARED_EXPORT
Definition bids_global.h:55
BIDS dataset reading, writing, path construction, and sidecar metadata handling for iEEG/EEG/MEG.
virtual QString formatName() const =0
Return a descriptive name for the format (e.g. "EDF", "BrainVision").
virtual ~AbstractFormatReader()=default
Virtual destructor.
virtual bool supportsExtension(const QString &sExtension) const =0
Check whether this reader can handle the given file extension.
virtual float getFrequency() const =0
Return the sampling frequency in Hz.
virtual long getSampleCount() const =0
Return total number of samples across the recording.
virtual FIFFLIB::FiffInfo getInfo() const =0
Return measurement metadata as FiffInfo.
virtual FIFFLIB::FiffRawData toFiffRawData() const =0
Convert the entire dataset to a FiffRawData structure.
virtual bool open(const QString &sFilePath)=0
Open and parse the file header. Must be called before reading data.
virtual int getChannelCount() const =0
Return the number of measurement channels.
std::unique_ptr< AbstractFormatReader > UPtr
virtual Eigen::MatrixXf readRawSegment(int iStartSampleIdx, int iEndSampleIdx) const =0
Read a segment of raw data.
FIFF measurement file information.
Definition fiff_info.h:86
FIFF raw measurement data.