v2.0.0
Loading...
Searching...
No Matches
fs_label.h
Go to the documentation of this file.
1//=============================================================================================================
28
29#ifndef FS_LABEL_H
30#define FS_LABEL_H
31
32//=============================================================================================================
33// INCLUDES
34//=============================================================================================================
35
36#include "fs_global.h"
37
38//=============================================================================================================
39// QT INCLUDES
40//=============================================================================================================
41
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
58const static Eigen::MatrixX3i defaultTris(0, 3);
59
60//=============================================================================================================
61// FORWARD DECLARATIONS
62//=============================================================================================================
63
64class FsSurface;
65
66//=============================================================================================================
81{
82public:
83 typedef QSharedPointer<FsLabel> SPtr;
84 typedef QSharedPointer<const FsLabel> ConstSPtr;
85
86 //=========================================================================================================
90 FsLabel();
91
92 //=========================================================================================================
103 FsLabel(const Eigen::VectorXi& p_vertices,
104 const Eigen::MatrixX3f& p_pos,
105 const Eigen::VectorXd& p_values,
106 qint32 p_hemi, const QString& p_name,
107 qint32 p_id = -1);
108
109 //=========================================================================================================
113 ~FsLabel();
114
115 //=========================================================================================================
119 void clear();
120
121 //=========================================================================================================
127 inline bool isEmpty() const;
128
129 //=========================================================================================================
137 Eigen::MatrixX3i selectTris(const FsSurface& p_Surface);
138
139 //=========================================================================================================
147 Eigen::MatrixX3i selectTris(const Eigen::MatrixX3i& p_matTris);
148
149 //=========================================================================================================
162 static bool read(const QString& p_sFileName, FsLabel& p_Label);
163
164public:
165 QString comment;
166 Eigen::VectorXi vertices;
167 Eigen::MatrixX3f pos;
168 Eigen::VectorXd values;
169 qint32 hemi;
170 // qint32 hemi; /**< Hemisphere (lh = 0; rh = 1; both = 2). */ Don't mix both hemis - KISS principle
171 QString name;
172 qint32 label_id;
173 // Eigen::MatrixX3i tris; /**< Tris for plotting (optional). */
174
175 // QMap<qint32, VectorXi> vertices; /**< Vertex indices (0 based). */
176 // QMap<qint32, Eigen::MatrixX3d> pos; /**< Locations in meters. */
177 // QMap<qint32, VectorXd> values; /**< Values at the vertices. */
178};
179
180//=============================================================================================================
181// INLINE DEFINITIONS
182//=============================================================================================================
183
184inline bool FsLabel::isEmpty() const
185{
186 return this->hemi == -1;
187}
188} // NAMESPACE
189
190#ifndef metatype_label
191#define metatype_label
193#endif
194
195#endif // FS_LABEL_H
Q_DECLARE_METATYPE(FSLIB::FsLabel)
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.
A FreeSurfer/MNE surface label: per-vertex indices, Tk-RAS positions and scalar values for one hemisp...
Definition fs_label.h:81
QSharedPointer< const FsLabel > ConstSPtr
Definition fs_label.h:84
QString comment
Definition fs_label.h:165
Eigen::VectorXd values
Definition fs_label.h:168
FsLabel(const Eigen::VectorXi &p_vertices, const Eigen::MatrixX3f &p_pos, const Eigen::VectorXd &p_values, qint32 p_hemi, const QString &p_name, qint32 p_id=-1)
Eigen::MatrixX3i selectTris(const Eigen::MatrixX3i &p_matTris)
QString name
Definition fs_label.h:171
bool isEmpty() const
Definition fs_label.h:184
static bool read(const QString &p_sFileName, FsLabel &p_Label)
Definition fs_label.cpp:154
Eigen::MatrixX3i selectTris(const FsSurface &p_Surface)
Definition fs_label.cpp:90
qint32 label_id
Definition fs_label.h:172
Eigen::MatrixX3f pos
Definition fs_label.h:167
QSharedPointer< FsLabel > SPtr
Definition fs_label.h:83
Eigen::VectorXi vertices
Definition fs_label.h:166
In-memory FreeSurfer triangular cortical surface for one hemisphere.
Definition fs_surface.h:94