v2.0.0
Loading...
Searching...
No Matches
fs_annotationset.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FS_ANNOTATIONSET_H
38#define FS_ANNOTATIONSET_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fs_global.h"
45#include "fs_annotation.h"
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QString>
52#include <QSharedPointer>
53#include <QMap>
54
55//=============================================================================================================
56// EIGEN INCLUDES
57//=============================================================================================================
58
59#include <Eigen/Core>
60
61//=============================================================================================================
62// DEFINE NAMESPACE FSLIB
63//=============================================================================================================
64
65namespace FSLIB
66{
67
68//=============================================================================================================
69// FORWARD DECLARATIONS
70//=============================================================================================================
71
72class FsSurfaceSet;
73
74//=============================================================================================================
81{
82public:
83 typedef QSharedPointer<FsAnnotationSet> SPtr;
84 typedef QSharedPointer<const FsAnnotationSet> ConstSPtr;
85
86 //=========================================================================================================
91
92 //=========================================================================================================
101 explicit FsAnnotationSet(const QString &subject_id, qint32 hemi, const QString &atlas, const QString &subjects_dir);
102
103 //=========================================================================================================
111 explicit FsAnnotationSet(const QString &path, qint32 hemi, const QString &atlas);
112
113 //=========================================================================================================
120 explicit FsAnnotationSet(const FsAnnotation& p_LHAnnotation, const FsAnnotation& p_RHAnnotation);
121
122 //=========================================================================================================
129 explicit FsAnnotationSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
130
131 //=========================================================================================================
136
137 //=========================================================================================================
141 void clear();
142
143 //=========================================================================================================
149 inline QMap<qint32, FsAnnotation>& data();
150
151 //=========================================================================================================
157 inline bool isEmpty() const;
158
159 //=========================================================================================================
165 void insert(const FsAnnotation& p_Annotation);
166
167 //=========================================================================================================
177 static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, FsAnnotationSet &p_AnnotationSet);
178
179 //=========================================================================================================
192 bool toLabels(const FsSurfaceSet &p_surfSet,
193 QList<FsLabel> &p_qListLabels,
194 QList<Eigen::RowVector4i> &p_qListLabelRGBAs,
195 const QStringList& lLabelPicks = QStringList()) const;
196
197 //=========================================================================================================
205 FsAnnotation& operator[] (qint32 idx);
206
207 //=========================================================================================================
215 const FsAnnotation operator[] (qint32 idx) const;
216
217 //=========================================================================================================
225 FsAnnotation& operator[] (QString idt);
226
227 //=========================================================================================================
235 const FsAnnotation operator[] (QString idt) const;
236
237 //=========================================================================================================
243 inline qint32 size() const;
244
245private:
246 QMap<qint32, FsAnnotation> m_qMapAnnots;
247};
248
249//=============================================================================================================
250// INLINE DEFINITIONS
251//=============================================================================================================
252
253inline QMap<qint32, FsAnnotation>& FsAnnotationSet::data()
254{
255 return m_qMapAnnots;
256}
257
258//=============================================================================================================
259
260inline bool FsAnnotationSet::isEmpty() const
261{
262 return m_qMapAnnots.isEmpty();
263}
264
265//=============================================================================================================
266
267inline qint32 FsAnnotationSet::size() const
268{
269 return m_qMapAnnots.size();
270}
271} // NAMESPACE
272
273#endif // FS_ANNOTATIONSET_H
Fs library export/import macros.
#define FSSHARED_EXPORT
Definition fs_global.h:52
FsAnnotation class declaration.
FreeSurfer surface and annotation I/O.
Free surfer annotation.
QSharedPointer< FsAnnotationSet > SPtr
QSharedPointer< const FsAnnotationSet > ConstSPtr
QMap< qint32, FsAnnotation > & data()
A hemisphere set of surfaces.