MNE-CPP  beta 1.0
annotation.h
Go to the documentation of this file.
1 //=============================================================================================================
37 #ifndef ANNOTATION_H
38 #define ANNOTATION_H
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "fs_global.h"
46 #include "colortable.h"
47 
48 
49 //*************************************************************************************************************
50 //=============================================================================================================
51 // QT INCLUDES
52 //=============================================================================================================
53 
54 #include <QString>
55 #include <QSharedPointer>
56 
57 
58 //*************************************************************************************************************
59 //=============================================================================================================
60 // Eigen INCLUDES
61 //=============================================================================================================
62 
63 #include <Eigen/Core>
64 
65 
66 //*************************************************************************************************************
67 //=============================================================================================================
68 // DEFINE NAMESPACE FSLIB
69 //=============================================================================================================
70 
71 namespace FSLIB
72 {
73 
74 //*************************************************************************************************************
75 //=============================================================================================================
76 // USED NAMESPACES
77 //=============================================================================================================
78 
79 using namespace Eigen;
80 
81 
82 //*************************************************************************************************************
83 //=============================================================================================================
84 // FORWARD DECLARATIONS
85 //=============================================================================================================
86 
87 class Label;
88 class Surface;
89 
90 
91 //=============================================================================================================
98 {
99 
100 public:
101  typedef QSharedPointer<Annotation> SPtr;
102  typedef QSharedPointer<const Annotation> ConstSPtr;
104  //=========================================================================================================
108  Annotation();
109 
110  //=========================================================================================================
116  explicit Annotation(const QString& p_sFileName);
117 
118  //=========================================================================================================
122  ~Annotation();
123 
124  //=========================================================================================================
128  void clear();
129 
130  //=========================================================================================================
136  inline bool isEmpty() const;
137 
138  //=========================================================================================================
144  inline qint32 hemi() const;
145 
146  //=========================================================================================================
152  inline VectorXi& getVertices();
153 
154  //=========================================================================================================
160  inline const VectorXi getVertices() const;
161 
162  //=========================================================================================================
168  inline VectorXi& getLabelIds();
169 
170  //=========================================================================================================
176  inline const VectorXi getLabelIds() const;
177 
178  //=========================================================================================================
184  inline Colortable& getColortable();
185 
186  //=========================================================================================================
192  inline const Colortable getColortable() const;
193 
194  //=========================================================================================================
206  static bool read(const QString &subject_id, qint32 hemi, const QString &atlas, const QString &subjects_dir, Annotation &p_Annotation);
207 
208  //=========================================================================================================
219  static bool read(const QString &path, qint32 hemi, const QString &atlas, Annotation &p_Annotation);
220 
221  //=========================================================================================================
230  static bool read(const QString &p_sFileName, Annotation &p_Annotation);
231 
232  //=========================================================================================================
244  bool toLabels(const Surface &p_surf, QList<Label> &p_qListLabels, QList<RowVector4i> &p_qListLabelRGBAs) const;
245 
246 private:
247  QString m_sFileName;
249  qint32 m_iHemi;
250  VectorXi m_Vertices;
251  VectorXi m_LabelIds;
253  Colortable m_Colortable;
254 };
255 
256 //*************************************************************************************************************
257 //=============================================================================================================
258 // INLINE DEFINITIONS
259 //=============================================================================================================
260 
261 inline qint32 Annotation::hemi() const
262 {
263  return m_iHemi;
264 }
265 
266 //*************************************************************************************************************
267 
268 inline bool Annotation::isEmpty() const
269 {
270  return m_iHemi == -1;
271 }
272 
273 //*************************************************************************************************************
274 
275 inline VectorXi& Annotation::getVertices()
276 {
277  return m_Vertices;
278 }
279 
280 
281 //*************************************************************************************************************
282 
283 inline const VectorXi Annotation::getVertices() const
284 {
285  return m_Vertices;
286 }
287 
288 
289 //*************************************************************************************************************
290 
291 inline VectorXi& Annotation::getLabelIds()
292 {
293  return m_LabelIds;
294 }
295 
296 
297 //*************************************************************************************************************
298 
299 inline const VectorXi Annotation::getLabelIds() const
300 {
301  return m_LabelIds;
302 }
303 
304 
305 //*************************************************************************************************************
306 
308 {
309  return m_Colortable;
310 }
311 
312 
313 //*************************************************************************************************************
314 
316 {
317  return m_Colortable;
318 }
319 
320 } // NAMESPACE
321 
322 #endif // ANNOTATION_H
QSharedPointer< const Annotation > ConstSPtr
Definition: annotation.h:102
Free surfer annotation.
Definition: annotation.h:97
Fs library export/import macros.
Colortable class declaration.
VectorXi & getVertices()
Definition: annotation.h:275
qint32 hemi() const
Definition: annotation.h:261
VectorXi & getLabelIds()
Definition: annotation.h:291
FreeSurfer surface mesh.
Definition: surface.h:92
#define FSSHARED_EXPORT
Definition: fs_global.h:58
Vertices label based lookup table.
Definition: colortable.h:79
Colortable & getColortable()
Definition: annotation.h:307
QSharedPointer< Annotation > SPtr
Definition: annotation.h:101
bool isEmpty() const
Definition: annotation.h:268