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//=============================================================================================================
79{
80public:
81 typedef QSharedPointer<FsLabel> SPtr;
82 typedef QSharedPointer<const FsLabel> ConstSPtr;
83
84 //=========================================================================================================
88 FsLabel();
89
90 //=========================================================================================================
101 FsLabel(const Eigen::VectorXi &p_vertices,
102 const Eigen::MatrixX3f &p_pos,
103 const Eigen::VectorXd &p_values,
104 qint32 p_hemi, const QString &p_name,
105 qint32 p_id = -1);
106
107 //=========================================================================================================
111 ~FsLabel();
112
113 //=========================================================================================================
117 void clear();
118
119 //=========================================================================================================
125 inline bool isEmpty() const;
126
127 //=========================================================================================================
135 Eigen::MatrixX3i selectTris(const FsSurface & p_Surface);
136
137 //=========================================================================================================
145 Eigen::MatrixX3i selectTris(const Eigen::MatrixX3i &p_matTris);
146
147 //=========================================================================================================
160 static bool read(const QString& p_sFileName, FsLabel &p_Label);
161
162public:
163 QString comment;
164 Eigen::VectorXi vertices;
165 Eigen::MatrixX3f pos;
166 Eigen::VectorXd values;
167 qint32 hemi;
168// qint32 hemi; /**< Hemisphere (lh = 0; rh = 1; both = 2). */ Don't mix both hemis - KISS principle
169 QString name;
170 qint32 label_id;
171// Eigen::MatrixX3i tris; /**< Tris for plotting (optional). */
172
173// QMap<qint32, VectorXi> vertices; /**< Vertex indices (0 based). */
174// QMap<qint32, Eigen::MatrixX3d> pos; /**< Locations in meters. */
175// QMap<qint32, VectorXd> values; /**< Values at the vertices. */
176};
177
178//=============================================================================================================
179// INLINE DEFINITIONS
180//=============================================================================================================
181
182inline bool FsLabel::isEmpty() const
183{
184 return this->hemi == -1;
185}
186} // NAMESPACE
187
188#ifndef metatype_label
189#define metatype_label
191#endif
192
193#endif // FS_LABEL_H
Export/import macros and build-info accessors for the FSLIB FreeSurfer I/O library.
#define FSSHARED_EXPORT
Definition fs_global.h:38
Q_DECLARE_METATYPE(FSLIB::FsLabel)
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:79
QSharedPointer< const FsLabel > ConstSPtr
Definition fs_label.h:82
QString comment
Definition fs_label.h:163
Eigen::VectorXd values
Definition fs_label.h:166
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:169
bool isEmpty() const
Definition fs_label.h:182
static bool read(const QString &p_sFileName, FsLabel &p_Label)
Definition fs_label.cpp:156
Eigen::MatrixX3i selectTris(const FsSurface &p_Surface)
Definition fs_label.cpp:90
qint32 label_id
Definition fs_label.h:170
Eigen::MatrixX3f pos
Definition fs_label.h:165
QSharedPointer< FsLabel > SPtr
Definition fs_label.h:81
Eigen::VectorXi vertices
Definition fs_label.h:164
In-memory FreeSurfer triangular cortical surface for one hemisphere.
Definition fs_surface.h:92