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//=============================================================================================================
98{
99public:
100 using SPtr = QSharedPointer<BidsRawData>;
101 using ConstSPtr = QSharedPointer<const BidsRawData>;
102
103 //=========================================================================================================
108 {
109 bool overwrite{false};
110 bool copyData{true};
112 QString datasetName;
113 };
114
115 //=========================================================================================================
119 BidsRawData() = default;
120
121 //=========================================================================================================
125 ~BidsRawData() = default;
126
127 // Move-only: the reader holds exclusive ownership of the open file.
128 BidsRawData(BidsRawData&& other) noexcept;
129 BidsRawData& operator=(BidsRawData&& other) noexcept;
130 BidsRawData(const BidsRawData&) = delete;
132
133 //=========================================================================================================
134 // I/O — read
135 //=========================================================================================================
136
153 static BidsRawData read(const BIDSPath& bidsPath);
154
155 //=========================================================================================================
156 // I/O — write
157 //=========================================================================================================
158
178 BIDSPath write(const BIDSPath& bidsPath,
179 const QString& sourcePath,
180 const WriteOptions& options) const;
181
185 inline BIDSPath write(const BIDSPath& bidsPath,
186 const QString& sourcePath = QString()) const
187 {
188 return write(bidsPath, sourcePath, WriteOptions());
189 }
190
191 //=========================================================================================================
192 // Query
193 //=========================================================================================================
194
198 bool isValid() const { return m_bIsValid; }
199
203 void setValid(bool bValid) { m_bIsValid = bValid; }
204
208 void clear();
209
210 //=========================================================================================================
211 // Static helpers
212 //=========================================================================================================
213
221 static AbstractFormatReader::UPtr createReader(const QString& sExtension);
222
223 //=========================================================================================================
224 // Core data members (public, following mne-cpp convention)
225 //=========================================================================================================
226
227 FIFFLIB::FiffRawData raw;
228 QList<BidsEvent> events;
229 QMap<QString, int> eventIdMap;
230 QList<BidsElectrode> electrodes;
233
234 //=========================================================================================================
235 // iEEG sidecar metadata (integrated from *_{datatype}.json)
236 // Fields derivable from FiffInfo (sfreq, channel counts) are omitted —
237 // they are computed on write and applied on read.
238 //=========================================================================================================
239
242 QString manufacturer;
246
247private:
248 bool m_bIsValid{false};
249};
250
251} // namespace BIDSLIB
252
253#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...
Reader/writer for the BIDS _coordsystem.json sidecar describing the spatial reference frame of an _el...
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.
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:93
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