MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
colortable.h
Go to the documentation of this file.
1//=============================================================================================================
37#ifndef COLORTABLE_H
38#define COLORTABLE_H
39
40//=============================================================================================================
41// QT INCLUDES
42//=============================================================================================================
43
44#include <QString>
45#include <QStringList>
46#include <QSharedPointer>
47
48//=============================================================================================================
49// EIGEN INCLUDES
50//=============================================================================================================
51
52#include <Eigen/Core>
53
54//=============================================================================================================
55// DEFINE NAMESPACE FSLIB
56//=============================================================================================================
57
58namespace FSLIB
59{
60
61//=============================================================================================================
68{
69public:
70 typedef QSharedPointer<Colortable> SPtr;
71 typedef QSharedPointer<const Colortable> ConstSPtr;
73 //=========================================================================================================
77 explicit Colortable();
78
79 //=========================================================================================================
83 void clear();
84
85 //=========================================================================================================
91 inline Eigen::VectorXi getLabelIds() const;
92
93 //=========================================================================================================
99 inline QStringList getNames() const;
100
101 //=========================================================================================================
107 inline Eigen::MatrixX4i getRGBAs() const;
108
109public:
110 QString orig_tab;
111 qint32 numEntries;
112 QStringList struct_names;
113 Eigen::MatrixXi table;
114};
115
116//=============================================================================================================
117// INLINE DEFINITIONS
118//=============================================================================================================
119
120inline Eigen::VectorXi Colortable::getLabelIds() const
121{
122 Eigen::VectorXi p_vecIds;
123 if (table.cols() == 5)
124 p_vecIds = table.block(0,4,table.rows(),1);
125
126 return p_vecIds;
127}
128
129//=============================================================================================================
130
131inline QStringList Colortable::getNames() const
132{
133 return struct_names;
134}
135
136//=============================================================================================================
137
138inline Eigen::MatrixX4i Colortable::getRGBAs() const
139{
140 Eigen::MatrixX4i p_matRGBAs;
141 if (table.cols() == 5)
142 p_matRGBAs = table.block(0,0,table.rows(),4);
143
144 return p_matRGBAs;
145}
146} // NAMESPACE
147
148#endif // COLORTABLE_H
Vertices label based lookup table.
Definition colortable.h:68
Eigen::MatrixX4i getRGBAs() const
Definition colortable.h:138
QSharedPointer< Colortable > SPtr
Definition colortable.h:70
QStringList getNames() const
Definition colortable.h:131
Eigen::VectorXi getLabelIds() const
Definition colortable.h:120
QSharedPointer< const Colortable > ConstSPtr
Definition colortable.h:71
QStringList struct_names
Definition colortable.h:112
Eigen::MatrixXi table
Definition colortable.h:113