MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
label.h
Go to the documentation of this file.
1//=============================================================================================================
37#ifndef LABEL_H
38#define LABEL_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fs_global.h"
45
46//=============================================================================================================
47// QT INCLUDES
48//=============================================================================================================
49
50#include <QSharedPointer>
51#include <QMap>
52
53//=============================================================================================================
54// EIGEN INCLUDES
55//=============================================================================================================
56
57#include <Eigen/Core>
58
59//=============================================================================================================
60// DEFINE NAMESPACE FSLIB
61//=============================================================================================================
62
63namespace FSLIB
64{
65
66const static Eigen::MatrixX3i defaultTris(0,3);
67
68//=============================================================================================================
69// FORWARD DECLARATIONS
70//=============================================================================================================
71
72class Surface;
73
74//=============================================================================================================
81{
82public:
83 typedef QSharedPointer<Label> SPtr;
84 typedef QSharedPointer<const Label> ConstSPtr;
86 //=========================================================================================================
90 Label();
91
92 //=========================================================================================================
103 Label(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 ~Label();
114
115 //=========================================================================================================
119 void clear();
120
121 //=========================================================================================================
127 inline bool isEmpty() const;
128
129 //=========================================================================================================
137 Eigen::MatrixX3i selectTris(const Surface & p_Surface);
138
139 //=========================================================================================================
147 Eigen::MatrixX3i selectTris(const Eigen::MatrixX3i &p_matTris);
148
149 //=========================================================================================================
162 static bool read(const QString& p_sFileName, Label &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 Label::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 // LABEL_H
Fs library export/import macros.
#define FSSHARED_EXPORT
Definition fs_global.h:56
Q_DECLARE_METATYPE(Eigen::MatrixXf)
Freesurfer/MNE label.
Definition label.h:81
qint32 label_id
Definition label.h:172
QSharedPointer< const Label > ConstSPtr
Definition label.h:84
QSharedPointer< Label > SPtr
Definition label.h:83
Eigen::VectorXi vertices
Definition label.h:166
QString comment
Definition label.h:165
qint32 hemi
Definition label.h:169
Eigen::MatrixX3i selectTris(const Eigen::MatrixX3i &p_matTris)
bool isEmpty() const
Definition label.h:184
Eigen::VectorXd values
Definition label.h:168
Eigen::MatrixX3f pos
Definition label.h:167
Label(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)
QString name
Definition label.h:171
FreeSurfer surface mesh.
Definition surface.h:76