MNE-CPP  beta 1.0
label.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef LABEL_H
37 #define LABEL_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "fs_global.h"
45 
46 
47 //*************************************************************************************************************
48 //=============================================================================================================
49 // QT INCLUDES
50 //=============================================================================================================
51 
52 #include <QSharedPointer>
53 #include <QMap>
54 
55 
56 //*************************************************************************************************************
57 //=============================================================================================================
58 // Eigen INCLUDES
59 //=============================================================================================================
60 
61 #include <Eigen/Core>
62 
63 
64 //*************************************************************************************************************
65 //=============================================================================================================
66 // DEFINE NAMESPACE FSLIB
67 //=============================================================================================================
68 
69 namespace FSLIB
70 {
71 
72 const static Eigen::MatrixX3i defaultTris(0,3);
73 
74 
75 //*************************************************************************************************************
76 //=============================================================================================================
77 // USED NAMESPACES
78 //=============================================================================================================
79 
80 using namespace Eigen;
81 
82 
83 //*************************************************************************************************************
84 //=============================================================================================================
85 // FORWARD DECLARATIONS
86 //=============================================================================================================
87 
88 class Surface;
89 
90 
91 //=============================================================================================================
98 {
99 public:
100  typedef QSharedPointer<Label> SPtr;
101  typedef QSharedPointer<const Label> ConstSPtr;
103  //=========================================================================================================
107  Label();
108 
109  //=========================================================================================================
120  Label(const VectorXi &p_vertices, const MatrixX3f &p_pos, const VectorXd &p_values, qint32 p_hemi, const QString &p_name, qint32 p_id = -1);
121 
122  //=========================================================================================================
126  ~Label();
127 
128  //=========================================================================================================
132  void clear();
133 
134  //=========================================================================================================
140  inline bool isEmpty() const;
141 
142  //=========================================================================================================
150  MatrixX3i selectTris(const Surface & p_Surface);
151 
152  //=========================================================================================================
160  MatrixX3i selectTris(const MatrixX3i &p_matTris);
161 
162  //=========================================================================================================
175  static bool read(const QString& p_sFileName, Label &p_Label);
176 
177 public:
178  QString comment;
179  VectorXi vertices;
180  MatrixX3f pos;
181  VectorXd values;
182  qint32 hemi;
183 // qint32 hemi; /**< Hemisphere (lh = 0; rh = 1; both = 2) */ Don't mix both hemis - KISS principle
184  QString name;
185  qint32 label_id;
186 // MatrixX3i tris; /**< Tris for plotting (optional) */
187 
188 // QMap<qint32, VectorXi> vertices; /**< Vertex indices (0 based) */
189 // QMap<qint32, MatrixX3d> pos; /**< Locations in meters */
190 // QMap<qint32, VectorXd> values; /**< Values at the vertices */
191 };
192 
193 //*************************************************************************************************************
194 //=============================================================================================================
195 // INLINE DEFINITIONS
196 //=============================================================================================================
197 
198 inline bool Label::isEmpty() const
199 {
200  return this->hemi == -1;
201 }
202 
203 } // NAMESPACE
204 
205 #endif // LABEL_H
QSharedPointer< const Label > ConstSPtr
Definition: label.h:101
MatrixX3f pos
Definition: label.h:180
QSharedPointer< Label > SPtr
Definition: label.h:100
Fs library export/import macros.
QString comment
Definition: label.h:178
qint32 hemi
Definition: label.h:182
QString name
Definition: label.h:184
FreeSurfer surface mesh.
Definition: surface.h:92
VectorXi vertices
Definition: label.h:179
qint32 label_id
Definition: label.h:185
#define FSSHARED_EXPORT
Definition: fs_global.h:58
bool isEmpty() const
Definition: label.h:198
Freesurfer/MNE label.
Definition: label.h:97
VectorXd values
Definition: label.h:181