v2.0.0
Loading...
Searching...
No Matches
bids_raw_data.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef BIDS_RAW_DATA_H
36#define BIDS_RAW_DATA_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "bids_global.h"
43#include "bids_event.h"
44#include "bids_electrode.h"
46#include "bids_path.h"
48
49#include <fiff/fiff_raw_data.h>
50
51//=============================================================================================================
52// QT INCLUDES
53//=============================================================================================================
54
55#include <QSharedPointer>
56#include <QString>
57#include <QList>
58#include <QMap>
59
60//=============================================================================================================
61// DEFINE NAMESPACE BIDSLIB
62//=============================================================================================================
63
64namespace BIDSLIB
65{
66
67//=============================================================================================================
88{
89public:
90 using SPtr = QSharedPointer<BidsRawData>;
91 using ConstSPtr = QSharedPointer<const BidsRawData>;
92
93 //=========================================================================================================
98 {
99 bool overwrite{false};
100 bool copyData{true};
102 QString datasetName;
103 };
104
105 //=========================================================================================================
109 BidsRawData() = default;
110
111 //=========================================================================================================
115 ~BidsRawData() = default;
116
117 // Move-only: the reader holds exclusive ownership of the open file.
118 BidsRawData(BidsRawData&& other) noexcept;
119 BidsRawData& operator=(BidsRawData&& other) noexcept;
120 BidsRawData(const BidsRawData&) = delete;
122
123 //=========================================================================================================
124 // I/O — read
125 //=========================================================================================================
126
143 static BidsRawData read(const BIDSPath& bidsPath);
144
145 //=========================================================================================================
146 // I/O — write
147 //=========================================================================================================
148
168 BIDSPath write(const BIDSPath& bidsPath,
169 const QString& sourcePath,
170 const WriteOptions& options) const;
171
180 inline BIDSPath write(const BIDSPath& bidsPath,
181 const QString& sourcePath = QString()) const
182 {
183 return write(bidsPath, sourcePath, WriteOptions());
184 }
185
186 //=========================================================================================================
187 // Query
188 //=========================================================================================================
189
195 bool isValid() const
196 {
197 return m_bIsValid;
198 }
199
205 void setValid(bool bValid)
206 {
207 m_bIsValid = bValid;
208 }
209
213 void clear();
214
215 //=========================================================================================================
216 // Static helpers
217 //=========================================================================================================
218
226 static AbstractFormatReader::UPtr createReader(const QString& sExtension);
227
228 //=========================================================================================================
229 // Core data members (public, following mne-cpp convention)
230 //=========================================================================================================
231
233 QList<BidsEvent> events;
234 QMap<QString, int> eventIdMap;
235 QList<BidsElectrode> electrodes;
238
239 //=========================================================================================================
240 // iEEG sidecar metadata (integrated from *_{datatype}.json)
241 // Fields derivable from FiffInfo (sfreq, channel counts) are omitted —
242 // they are computed on write and applied on read.
243 //=========================================================================================================
244
247 QString manufacturer;
251
252private:
253 bool m_bIsValid{false};
254};
255
256} // namespace BIDSLIB
257
258#endif // BIDS_RAW_DATA_H
Reader/writer for the BIDS _events.tsv sidecar — discrete annotations on the time axis of a recording...
Programmatic construction and matching of BIDS-compliant directories, filenames and sidecar paths.
Strategy interface for format-specific raw-data readers (BrainVision, EDF, …) consumed by BIDSLIB::Bi...
MNE-CPP BIDS library entry point: Qt symbol-visibility plumbing and the BIDSLIB namespace documentati...
#define BIDSSHARED_EXPORT
Definition bids_global.h:43
Reader/writer for the BIDS _electrodes.tsv sidecar plus a bridge into FIFF digitizer-point space.
Reader/writer for the BIDS _coordsystem.json sidecar describing the spatial reference frame of an _el...
FIFF continuous raw recording: FiffInfo plus a directory of FIFF_DATA_BUFFER tags for random-access s...
BIDS dataset reading, writing, path construction, and sidecar metadata handling for iEEG/EEG/MEG.
Coordinate system metadata from *_coordsystem.json.
BIDS-compliant path and filename construction.
Definition bids_path.h:74
static BidsRawData read(const BIDSPath &bidsPath)
Read a BIDS dataset from disk.
BIDSPath write(const BIDSPath &bidsPath, const QString &sourcePath=QString()) const
Convenience overload — write with default options.
bool isValid() const
Returns true if the data was loaded successfully.
FIFFLIB::FiffRawData raw
AbstractFormatReader::UPtr reader
BidsRawData(const BidsRawData &)=delete
QSharedPointer< BidsRawData > SPtr
QMap< QString, int > eventIdMap
BidsRawData & operator=(const BidsRawData &)=delete
void setValid(bool bValid)
Marks the data as valid or invalid.
QList< BidsElectrode > electrodes
QSharedPointer< const BidsRawData > ConstSPtr
BidsRawData & operator=(BidsRawData &&other) noexcept
QList< BidsEvent > events
BidsCoordinateSystem coordinateSystem
BIDSPath write(const BIDSPath &bidsPath, const QString &sourcePath, const WriteOptions &options) const
Write this dataset to a BIDS-compliant directory.
Options controlling how write() operates.
std::unique_ptr< AbstractFormatReader > UPtr
Continuous FIFF raw recording: FiffInfo plus a random-access directory of FIFF_DATA_BUFFER tags.