v2.0.0
Loading...
Searching...
No Matches
fs_annotation.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef FS_ANNOTATION_H
36#define FS_ANNOTATION_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "fs_global.h"
43#include "fs_colortable.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QString>
50#include <QSharedPointer>
51
52//=============================================================================================================
53// EIGEN INCLUDES
54//=============================================================================================================
55
56#include <Eigen/Core>
57
58//=============================================================================================================
59// DEFINE NAMESPACE FSLIB
60//=============================================================================================================
61
62namespace FSLIB
63{
64
65//=============================================================================================================
66// FORWARD DECLARATIONS
67//=============================================================================================================
68
69class FsLabel;
70class FsSurface;
71
72//=============================================================================================================
83{
84
85public:
86 typedef QSharedPointer<FsAnnotation> SPtr;
87 typedef QSharedPointer<const FsAnnotation> ConstSPtr;
88
89 //=========================================================================================================
94
95 //=========================================================================================================
101 explicit FsAnnotation(const QString& p_sFileName);
102
103 //=========================================================================================================
112 explicit FsAnnotation(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir);
113
114 //=========================================================================================================
124 explicit FsAnnotation(const QString &path, qint32 hemi, const QString &surf);
125
126 //=========================================================================================================
131
132 //=========================================================================================================
136 void clear();
137
138 //=========================================================================================================
144 inline bool isEmpty() const;
145
146 //=========================================================================================================
152 inline qint32 hemi() const;
153
154 //=========================================================================================================
160 inline Eigen::VectorXi& getVertices();
161
162 //=========================================================================================================
168 inline const Eigen::VectorXi getVertices() const;
169
170 //=========================================================================================================
176 inline Eigen::VectorXi& getLabelIds();
177
178 //=========================================================================================================
184 inline const Eigen::VectorXi getLabelIds() const;
185
186 //=========================================================================================================
192 inline FsColortable& getColortable();
193
194 //=========================================================================================================
200 inline const FsColortable getColortable() const;
201
202 //=========================================================================================================
214 static bool read(const QString &subject_id, qint32 hemi, const QString &atlas, const QString &subjects_dir, FsAnnotation &p_Annotation);
215
216 //=========================================================================================================
227 static bool read(const QString &path, qint32 hemi, const QString &atlas, FsAnnotation &p_Annotation);
228
229 //=========================================================================================================
238 static bool read(const QString &p_sFileName, FsAnnotation &p_Annotation);
239
240 //=========================================================================================================
253 bool toLabels(const FsSurface &p_surf,
254 QList<FsLabel> &p_qListLabels,
255 QList<Eigen::RowVector4i> &p_qListLabelRGBAs,
256 const QStringList& lLabelPicks = QStringList()) const;
257
258 //=========================================================================================================
264 inline QString filePath() const;
265
266 //=========================================================================================================
272 inline QString fileName() const;
273
274private:
275 QString m_sFileName;
276 QString m_sFilePath;
277
278 qint32 m_iHemi;
279 Eigen::VectorXi m_Vertices;
280 Eigen::VectorXi m_LabelIds;
281
282 FsColortable m_Colortable;
283};
284
285//=============================================================================================================
286// INLINE DEFINITIONS
287//=============================================================================================================
288
289inline qint32 FsAnnotation::hemi() const
290{
291 return m_iHemi;
292}
293
294//=============================================================================================================
295
296inline bool FsAnnotation::isEmpty() const
297{
298 return m_iHemi == -1;
299}
300
301//=============================================================================================================
302
303inline Eigen::VectorXi& FsAnnotation::getVertices()
304{
305 return m_Vertices;
306}
307
308//=============================================================================================================
309
310inline const Eigen::VectorXi FsAnnotation::getVertices() const
311{
312 return m_Vertices;
313}
314
315//=============================================================================================================
316
317inline Eigen::VectorXi& FsAnnotation::getLabelIds()
318{
319 return m_LabelIds;
320}
321
322//=============================================================================================================
323
324inline const Eigen::VectorXi FsAnnotation::getLabelIds() const
325{
326 return m_LabelIds;
327}
328
329//=============================================================================================================
330
332{
333 return m_Colortable;
334}
335
336//=============================================================================================================
337
339{
340 return m_Colortable;
341}
342
343//=============================================================================================================
344
345inline QString FsAnnotation::filePath() const
346{
347 return m_sFilePath;
348}
349
350//=============================================================================================================
351
352inline QString FsAnnotation::fileName() const
353{
354 return m_sFileName;
355}
356} // NAMESPACE
357
358#endif // FS_ANNOTATION_H
In-memory representation of a FreeSurfer colour/structure lookup table (FreeSurferColorLUT / embedded...
Export/import macros and build-info accessors for the FSLIB FreeSurfer I/O library.
#define FSSHARED_EXPORT
Definition fs_global.h:38
FreeSurfer surface, annotation and parcellation I/O for mne-cpp.
FsColortable & getColortable()
qint32 hemi() const
Eigen::VectorXi & getLabelIds()
QSharedPointer< FsAnnotation > SPtr
QString fileName() const
static bool read(const QString &subject_id, qint32 hemi, const QString &atlas, const QString &subjects_dir, FsAnnotation &p_Annotation)
QSharedPointer< const FsAnnotation > ConstSPtr
Eigen::VectorXi & getVertices()
QString filePath() const
bool toLabels(const FsSurface &p_surf, QList< FsLabel > &p_qListLabels, QList< Eigen::RowVector4i > &p_qListLabelRGBAs, const QStringList &lLabelPicks=QStringList()) const
FreeSurfer colour lookup table: region name + RGBA + packed label, indexed by entry.
A FreeSurfer/MNE surface label: per-vertex indices, Tk-RAS positions and scalar values for one hemisp...
Definition fs_label.h:79
In-memory FreeSurfer triangular cortical surface for one hemisphere.
Definition fs_surface.h:92