v2.0.0
Loading...
Searching...
No Matches
fs_annotationset.h
Go to the documentation of this file.
1//=============================================================================================================
26
27#ifndef FS_ANNOTATIONSET_H
28#define FS_ANNOTATIONSET_H
29
30//=============================================================================================================
31// INCLUDES
32//=============================================================================================================
33
34#include "fs_global.h"
35#include "fs_annotation.h"
36
37//=============================================================================================================
38// QT INCLUDES
39//=============================================================================================================
40
41#include <QString>
42#include <QSharedPointer>
43#include <QMap>
44
45//=============================================================================================================
46// EIGEN INCLUDES
47//=============================================================================================================
48
49#include <Eigen/Core>
50
51//=============================================================================================================
52// DEFINE NAMESPACE FSLIB
53//=============================================================================================================
54
55namespace FSLIB
56{
57
58//=============================================================================================================
59// FORWARD DECLARATIONS
60//=============================================================================================================
61
62class FsSurfaceSet;
63
64//=============================================================================================================
75{
76public:
77 typedef QSharedPointer<FsAnnotationSet> SPtr;
78 typedef QSharedPointer<const FsAnnotationSet> ConstSPtr;
79
80 //=========================================================================================================
85
86 //=========================================================================================================
95 explicit FsAnnotationSet(const QString &subject_id, qint32 hemi, const QString &atlas, const QString &subjects_dir);
96
97 //=========================================================================================================
105 explicit FsAnnotationSet(const QString &path, qint32 hemi, const QString &atlas);
106
107 //=========================================================================================================
114 explicit FsAnnotationSet(const FsAnnotation& p_LHAnnotation, const FsAnnotation& p_RHAnnotation);
115
116 //=========================================================================================================
123 explicit FsAnnotationSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
124
125 //=========================================================================================================
130
131 //=========================================================================================================
135 void clear();
136
137 //=========================================================================================================
143 inline QMap<qint32, FsAnnotation>& data();
144
145 //=========================================================================================================
151 inline bool isEmpty() const;
152
153 //=========================================================================================================
159 void insert(const FsAnnotation& p_Annotation);
160
161 //=========================================================================================================
171 static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, FsAnnotationSet &p_AnnotationSet);
172
173 //=========================================================================================================
186 bool toLabels(const FsSurfaceSet &p_surfSet,
187 QList<FsLabel> &p_qListLabels,
188 QList<Eigen::RowVector4i> &p_qListLabelRGBAs,
189 const QStringList& lLabelPicks = QStringList()) const;
190
191 //=========================================================================================================
199 FsAnnotation& operator[] (qint32 idx);
200
201 //=========================================================================================================
209 const FsAnnotation operator[] (qint32 idx) const;
210
211 //=========================================================================================================
219 FsAnnotation& operator[] (QString idt);
220
221 //=========================================================================================================
229 const FsAnnotation operator[] (QString idt) const;
230
231 //=========================================================================================================
237 inline qint32 size() const;
238
239private:
240 QMap<qint32, FsAnnotation> m_qMapAnnots;
241};
242
243//=============================================================================================================
244// INLINE DEFINITIONS
245//=============================================================================================================
246
247inline QMap<qint32, FsAnnotation>& FsAnnotationSet::data()
248{
249 return m_qMapAnnots;
250}
251
252//=============================================================================================================
253
254inline bool FsAnnotationSet::isEmpty() const
255{
256 return m_qMapAnnots.isEmpty();
257}
258
259//=============================================================================================================
260
261inline qint32 FsAnnotationSet::size() const
262{
263 return m_qMapAnnots.size();
264}
265} // NAMESPACE
266
267#endif // FS_ANNOTATIONSET_H
Export/import macros and build-info accessors for the FSLIB FreeSurfer I/O library.
#define FSSHARED_EXPORT
Definition fs_global.h:38
Reader for FreeSurfer per-vertex annotation (parcellation) files such as lh.aparc....
FreeSurfer surface, annotation and parcellation I/O for mne-cpp.
Single-hemisphere FreeSurfer parcellation: vertex → region label plus embedded colortable.
Container holding the lh and/or rh FsAnnotation for one parcellation atlas.
QSharedPointer< FsAnnotationSet > SPtr
QSharedPointer< const FsAnnotationSet > ConstSPtr
QMap< qint32, FsAnnotation > & data()
Container holding the lh and/or rh FsSurface for one subject and one surface kind.