MNE-CPP  beta 1.0
annotationset.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef ANNOTATION_SET_H
37 #define ANNOTATION_SET_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "fs_global.h"
45 #include "annotation.h"
46 
47 
48 //*************************************************************************************************************
49 //=============================================================================================================
50 // QT INCLUDES
51 //=============================================================================================================
52 
53 #include <QString>
54 #include <QSharedPointer>
55 #include <QMap>
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 SurfaceSet;
88 
89 
90 //=============================================================================================================
97 {
98 public:
99  typedef QSharedPointer<AnnotationSet> SPtr;
100  typedef QSharedPointer<const AnnotationSet> ConstSPtr;
102  //=========================================================================================================
106  AnnotationSet();
107 
108  //=========================================================================================================
117  explicit AnnotationSet(const QString &subject_id, qint32 hemi, const QString &atlas, const QString &subjects_dir);
118 
119  //=========================================================================================================
127  explicit AnnotationSet(const QString &path, qint32 hemi, const QString &atlas);
128 
129  //=========================================================================================================
136  explicit AnnotationSet(const Annotation& p_LHAnnotation, const Annotation& p_RHAnnotation);
137 
138  //=========================================================================================================
145  explicit AnnotationSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
146 
147  //=========================================================================================================
152 
153  //=========================================================================================================
157  void clear();
158 
159  //=========================================================================================================
165  inline bool isEmpty() const;
166 
167  //=========================================================================================================
173  void insert(const Annotation& p_Annotation);
174 
175  //=========================================================================================================
185  static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, AnnotationSet &p_AnnotationSet);
186 
187  //=========================================================================================================
199  bool toLabels(const SurfaceSet &p_surfSet, QList<Label> &p_qListLabels, QList<RowVector4i> &p_qListLabelRGBAs) const;
200 
201  //=========================================================================================================
209  Annotation& operator[] (qint32 idx);
210 
211  //=========================================================================================================
219  const Annotation operator[] (qint32 idx) const;
220 
221  //=========================================================================================================
229  Annotation& operator[] (QString idt);
230 
231  //=========================================================================================================
239  const Annotation operator[] (QString idt) const;
240 
241  //=========================================================================================================
247  inline qint32 size() const;
248 
249 private:
250  QMap<qint32, Annotation> m_qMapAnnots;
252 };
253 
254 //*************************************************************************************************************
255 //=============================================================================================================
256 // INLINE DEFINITIONS
257 //=============================================================================================================
258 
259 inline bool AnnotationSet::isEmpty() const
260 {
261  return m_qMapAnnots.isEmpty();
262 }
263 
264 
265 //*************************************************************************************************************
266 
267 inline qint32 AnnotationSet::size() const
268 {
269  return m_qMapAnnots.size();
270 }
271 
272 } // NAMESPACE
273 
274 #endif // ANNOTATION_SET_H
Free surfer annotation.
Definition: annotation.h:97
Fs library export/import macros.
Annotation class declaration.
Annotation set.
Definition: annotationset.h:96
qint32 size() const
QSharedPointer< const AnnotationSet > ConstSPtr
#define FSSHARED_EXPORT
Definition: fs_global.h:58
QSharedPointer< AnnotationSet > SPtr
Definition: annotationset.h:99
bool isEmpty() const
A hemisphere set of surfaces.
Definition: surfaceset.h:83