v2.0.0
Loading...
Searching...
No Matches
bids_path.h
Go to the documentation of this file.
1//=============================================================================================================
35
36#ifndef BIDS_PATH_H
37#define BIDS_PATH_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "bids_global.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QSharedPointer>
50#include <QString>
51#include <QMap>
52#include <QDir>
53
54//=============================================================================================================
55// DEFINE NAMESPACE BIDSLIB
56//=============================================================================================================
57
58namespace BIDSLIB
59{
60
61//=============================================================================================================
93{
94public:
95 using SPtr = QSharedPointer<BIDSPath>;
96 using ConstSPtr = QSharedPointer<const BIDSPath>;
97
98 //=========================================================================================================
102 BIDSPath();
103
104 //=========================================================================================================
116 BIDSPath(const QString& sRoot,
117 const QString& sSubject,
118 const QString& sSession = QString(),
119 const QString& sTask = QString(),
120 const QString& sDatatype = QString(),
121 const QString& sSuffix = QString(),
122 const QString& sExtension = QString());
123
124 //=========================================================================================================
128 BIDSPath(const BIDSPath& other);
129
130 //=========================================================================================================
134 ~BIDSPath();
135
136 //=========================================================================================================
137 // Entity setters
138 //=========================================================================================================
139
141 void setRoot(const QString& sRoot);
142
144 void setSubject(const QString& sSubject);
145
147 void setSession(const QString& sSession);
148
150 void setTask(const QString& sTask);
151
153 void setAcquisition(const QString& sAcquisition);
154
156 void setRun(const QString& sRun);
157
159 void setProcessing(const QString& sProcessing);
160
162 void setSpace(const QString& sSpace);
163
165 void setRecording(const QString& sRecording);
166
168 void setSplit(const QString& sSplit);
169
171 void setDescription(const QString& sDescription);
172
174 void setDatatype(const QString& sDatatype);
175
177 void setSuffix(const QString& sSuffix);
178
180 void setExtension(const QString& sExtension);
181
182 //=========================================================================================================
183 // Entity getters
184 //=========================================================================================================
185
186 QString root() const;
187 QString subject() const;
188 QString session() const;
189 QString task() const;
190 QString acquisition() const;
191 QString run() const;
192 QString processing() const;
193 QString space() const;
194 QString recording() const;
195 QString split() const;
196 QString description() const;
197 QString datatype() const;
198 QString suffix() const;
199 QString extension() const;
200
201 //=========================================================================================================
202 // Path construction
203 //=========================================================================================================
204
214 QString basename() const;
215
223 QString directory() const;
224
230 QString filePath() const;
231
232 //=========================================================================================================
233 // Convenience methods
234 //=========================================================================================================
235
244 BIDSPath withSuffix(const QString& sSuffix, const QString& sExtension) const;
245
251
257
263
268 BIDSPath eventsTsvPath() const;
269
276
281 bool exists() const;
282
287 bool mkdirs() const;
288
295 QList<BIDSPath> match() const;
296
297 //=========================================================================================================
298 // Validation
299 //=========================================================================================================
300
306 static bool isValidEntityValue(const QString& sValue);
307
308 //=========================================================================================================
309 // Operators
310 //=========================================================================================================
311
312 BIDSPath& operator=(const BIDSPath& other);
313 friend bool operator==(const BIDSPath& a, const BIDSPath& b);
314
315private:
316 QString m_sRoot;
317 QString m_sSubject;
318 QString m_sSession;
319 QString m_sTask;
320 QString m_sAcquisition;
321 QString m_sRun;
322 QString m_sProcessing;
323 QString m_sSpace;
324 QString m_sRecording;
325 QString m_sSplit;
326 QString m_sDescription;
327 QString m_sDatatype;
328 QString m_sSuffix;
329 QString m_sExtension;
330
334 static QString zeroPad(const QString& sValue);
335};
336
337} // namespace BIDSLIB
338
339#endif // BIDS_PATH_H
MNE-CPP BIDS library entry point: Qt symbol-visibility plumbing and the BIDSLIB namespace documentati...
#define BIDSSHARED_EXPORT
Definition bids_global.h:43
bool operator==(const BIDSPath &a, const BIDSPath &b)
BIDS dataset reading, writing, path construction, and sidecar metadata handling for iEEG/EEG/MEG.
QString subject() const
void setSession(const QString &sSession)
Definition bids_path.cpp:93
void setSpace(const QString &sSpace)
Definition bids_path.cpp:98
QString filePath() const
QString session() const
void setRecording(const QString &sRecording)
Definition bids_path.cpp:99
void setSubject(const QString &sSubject)
Definition bids_path.cpp:92
QString split() const
void setDatatype(const QString &sDatatype)
QString description() const
BIDSPath electrodesTsvPath() const
bool exists() const
QString run() const
void setDescription(const QString &sDescription)
void setRun(const QString &sRun)
Definition bids_path.cpp:96
void setAcquisition(const QString &sAcquisition)
Definition bids_path.cpp:95
QString root() const
void setSplit(const QString &sSplit)
QSharedPointer< BIDSPath > SPtr
Definition bids_path.h:95
BIDSPath channelsTsvPath() const
static bool isValidEntityValue(const QString &sValue)
QString directory() const
QString acquisition() const
void setTask(const QString &sTask)
Definition bids_path.cpp:94
BIDSPath & operator=(const BIDSPath &other)
QString extension() const
void setProcessing(const QString &sProcessing)
Definition bids_path.cpp:97
void setRoot(const QString &sRoot)
Definition bids_path.cpp:91
QString space() const
QString suffix() const
QString basename() const
void setSuffix(const QString &sSuffix)
QString processing() const
QString recording() const
BIDSPath coordsystemJsonPath() const
QList< BIDSPath > match() const
QString task() const
BIDSPath withSuffix(const QString &sSuffix, const QString &sExtension) const
BIDSPath eventsTsvPath() const
void setExtension(const QString &sExtension)
bool mkdirs() const
QString datatype() const
QSharedPointer< const BIDSPath > ConstSPtr
Definition bids_path.h:96
BIDSPath sidecarJsonPath() const