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//=============================================================================================================
77{
78public:
79 typedef QSharedPointer<FsAnnotationSet> SPtr;
80 typedef QSharedPointer<const FsAnnotationSet> ConstSPtr;
81
82 //=========================================================================================================
87
88 //=========================================================================================================
97 explicit FsAnnotationSet(const QString& subject_id, qint32 hemi, const QString& atlas, const QString& subjects_dir);
98
99 //=========================================================================================================
107 explicit FsAnnotationSet(const QString& path, qint32 hemi, const QString& atlas);
108
109 //=========================================================================================================
116 explicit FsAnnotationSet(const FsAnnotation& p_LHAnnotation, const FsAnnotation& p_RHAnnotation);
117
118 //=========================================================================================================
125 explicit FsAnnotationSet(const QString& p_sLHFileName, const QString& p_sRHFileName);
126
127 //=========================================================================================================
132 {
133 }
134
135 //=========================================================================================================
139 void clear();
140
141 //=========================================================================================================
147 inline QMap<qint32, FsAnnotation>& data();
148
149 //=========================================================================================================
155 inline bool isEmpty() const;
156
157 //=========================================================================================================
163 void insert(const FsAnnotation& p_Annotation);
164
165 //=========================================================================================================
175 static bool read(const QString& p_sLHFileName, const QString& p_sRHFileName, FsAnnotationSet& p_AnnotationSet);
176
177 //=========================================================================================================
190 bool toLabels(const FsSurfaceSet& p_surfSet,
191 QList<FsLabel>& p_qListLabels,
192 QList<Eigen::RowVector4i>& p_qListLabelRGBAs,
193 const QStringList& lLabelPicks = QStringList()) const;
194
195 //=========================================================================================================
203 FsAnnotation& operator[](qint32 idx);
204
205 //=========================================================================================================
213 const FsAnnotation operator[](qint32 idx) const;
214
215 //=========================================================================================================
223 FsAnnotation& operator[](QString idt);
224
225 //=========================================================================================================
233 const FsAnnotation operator[](QString idt) const;
234
235 //=========================================================================================================
241 inline qint32 size() const;
242
243private:
244 QMap<qint32, FsAnnotation> m_qMapAnnots;
245};
246
247//=============================================================================================================
248// INLINE DEFINITIONS
249//=============================================================================================================
250
251inline QMap<qint32, FsAnnotation>& FsAnnotationSet::data()
252{
253 return m_qMapAnnots;
254}
255
256//=============================================================================================================
257
258inline bool FsAnnotationSet::isEmpty() const
259{
260 return m_qMapAnnots.isEmpty();
261}
262
263//=============================================================================================================
264
265inline qint32 FsAnnotationSet::size() const
266{
267 return m_qMapAnnots.size();
268}
269} // NAMESPACE
270
271#endif // FS_ANNOTATIONSET_H
Reader for FreeSurfer per-vertex annotation (parcellation) files such as lh.aparc....
Export/import macros and build-info accessors for the FSLIB FreeSurfer I/O library.
#define FSSHARED_EXPORT
Definition fs_global.h:38
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.