MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
annotation.h
Go to the documentation of this file.
1//=============================================================================================================
37#ifndef ANNOTATION_H
38#define ANNOTATION_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fs_global.h"
45#include "colortable.h"
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QString>
52#include <QSharedPointer>
53
54//=============================================================================================================
55// EIGEN INCLUDES
56//=============================================================================================================
57
58#include <Eigen/Core>
59
60//=============================================================================================================
61// DEFINE NAMESPACE FSLIB
62//=============================================================================================================
63
64namespace FSLIB
65{
66
67//=============================================================================================================
68// FORWARD DECLARATIONS
69//=============================================================================================================
70
71class Label;
72class Surface;
73
74//=============================================================================================================
81{
82
83public:
84 typedef QSharedPointer<Annotation> SPtr;
85 typedef QSharedPointer<const Annotation> ConstSPtr;
87 //=========================================================================================================
91 Annotation();
92
93 //=========================================================================================================
99 explicit Annotation(const QString& p_sFileName);
100
101 //=========================================================================================================
110 explicit Annotation(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir);
111
112 //=========================================================================================================
122 explicit Annotation(const QString &path, qint32 hemi, const QString &surf);
123
124 //=========================================================================================================
128 ~Annotation();
129
130 //=========================================================================================================
134 void clear();
135
136 //=========================================================================================================
142 inline bool isEmpty() const;
143
144 //=========================================================================================================
150 inline qint32 hemi() const;
151
152 //=========================================================================================================
158 inline Eigen::VectorXi& getVertices();
159
160 //=========================================================================================================
166 inline const Eigen::VectorXi getVertices() const;
167
168 //=========================================================================================================
174 inline Eigen::VectorXi& getLabelIds();
175
176 //=========================================================================================================
182 inline const Eigen::VectorXi getLabelIds() const;
183
184 //=========================================================================================================
190 inline Colortable& getColortable();
191
192 //=========================================================================================================
198 inline const Colortable getColortable() const;
199
200 //=========================================================================================================
212 static bool read(const QString &subject_id, qint32 hemi, const QString &atlas, const QString &subjects_dir, Annotation &p_Annotation);
213
214 //=========================================================================================================
225 static bool read(const QString &path, qint32 hemi, const QString &atlas, Annotation &p_Annotation);
226
227 //=========================================================================================================
236 static bool read(const QString &p_sFileName, Annotation &p_Annotation);
237
238 //=========================================================================================================
251 bool toLabels(const Surface &p_surf,
252 QList<Label> &p_qListLabels,
253 QList<Eigen::RowVector4i> &p_qListLabelRGBAs,
254 const QStringList& lLabelPicks = QStringList()) const;
255
256 //=========================================================================================================
262 inline QString filePath() const;
263
264 //=========================================================================================================
270 inline QString fileName() const;
271
272private:
273 QString m_sFileName;
274 QString m_sFilePath;
276 qint32 m_iHemi;
277 Eigen::VectorXi m_Vertices;
278 Eigen::VectorXi m_LabelIds;
280 Colortable m_Colortable;
281};
282
283//=============================================================================================================
284// INLINE DEFINITIONS
285//=============================================================================================================
286
287inline qint32 Annotation::hemi() const
288{
289 return m_iHemi;
290}
291
292//=============================================================================================================
293
294inline bool Annotation::isEmpty() const
295{
296 return m_iHemi == -1;
297}
298
299//=============================================================================================================
300
301inline Eigen::VectorXi& Annotation::getVertices()
302{
303 return m_Vertices;
304}
305
306//=============================================================================================================
307
308inline const Eigen::VectorXi Annotation::getVertices() const
309{
310 return m_Vertices;
311}
312
313//=============================================================================================================
314
315inline Eigen::VectorXi& Annotation::getLabelIds()
316{
317 return m_LabelIds;
318}
319
320//=============================================================================================================
321
322inline const Eigen::VectorXi Annotation::getLabelIds() const
323{
324 return m_LabelIds;
325}
326
327//=============================================================================================================
328
330{
331 return m_Colortable;
332}
333
334//=============================================================================================================
335
337{
338 return m_Colortable;
339}
340
341//=============================================================================================================
342
343inline QString Annotation::filePath() const
344{
345 return m_sFilePath;
346}
347
348//=============================================================================================================
349
350inline QString Annotation::fileName() const
351{
352 return m_sFileName;
353}
354} // NAMESPACE
355
356#endif // ANNOTATION_H
Fs library export/import macros.
#define FSSHARED_EXPORT
Definition fs_global.h:56
Colortable class declaration.
Free surfer annotation.
Definition annotation.h:81
QSharedPointer< const Annotation > ConstSPtr
Definition annotation.h:85
QString filePath() const
Definition annotation.h:343
Eigen::VectorXi & getVertices()
Definition annotation.h:301
Eigen::VectorXi & getLabelIds()
Definition annotation.h:315
bool isEmpty() const
Definition annotation.h:294
QString fileName() const
Definition annotation.h:350
Colortable & getColortable()
Definition annotation.h:329
QSharedPointer< Annotation > SPtr
Definition annotation.h:84
qint32 hemi() const
Definition annotation.h:287
Vertices label based lookup table.
Definition colortable.h:68
FreeSurfer surface mesh.
Definition surface.h:76