v2.0.0
Loading...
Searching...
No Matches
fs_colortable.h
Go to the documentation of this file.
1//=============================================================================================================
29
30#ifndef FS_COLORTABLE_H
31#define FS_COLORTABLE_H
32
33//=============================================================================================================
34// FS INCLUDES
35//=============================================================================================================
36
37#include "fs_global.h"
38
39//=============================================================================================================
40// QT INCLUDES
41//=============================================================================================================
42
43#include <QString>
44#include <QStringList>
45#include <QSharedPointer>
46
47//=============================================================================================================
48// EIGEN INCLUDES
49//=============================================================================================================
50
51#include <Eigen/Core>
52
53//=============================================================================================================
54// DEFINE NAMESPACE FSLIB
55//=============================================================================================================
56
57namespace FSLIB
58{
59
60//=============================================================================================================
72{
73public:
74 typedef QSharedPointer<FsColortable> SPtr;
75 typedef QSharedPointer<const FsColortable> ConstSPtr;
76
77 //=========================================================================================================
81 explicit FsColortable();
82
83 //=========================================================================================================
87 void clear();
88
89 //=========================================================================================================
95 inline Eigen::VectorXi getLabelIds() const;
96
97 //=========================================================================================================
103 inline QStringList getNames() const;
104
105 //=========================================================================================================
111 inline Eigen::MatrixX4i getRGBAs() const;
112
113public:
114 QString orig_tab;
115 qint32 numEntries;
116 QStringList struct_names;
117 Eigen::MatrixXi table;
118};
119
120//=============================================================================================================
121// INLINE DEFINITIONS
122//=============================================================================================================
123
124inline Eigen::VectorXi FsColortable::getLabelIds() const
125{
126 Eigen::VectorXi p_vecIds;
127 if (table.cols() == 5)
128 p_vecIds = table.block(0,4,table.rows(),1);
129
130 return p_vecIds;
131}
132
133//=============================================================================================================
134
135inline QStringList FsColortable::getNames() const
136{
137 return struct_names;
138}
139
140//=============================================================================================================
141
142inline Eigen::MatrixX4i FsColortable::getRGBAs() const
143{
144 Eigen::MatrixX4i p_matRGBAs;
145 if (table.cols() == 5)
146 p_matRGBAs = table.block(0,0,table.rows(),4);
147
148 return p_matRGBAs;
149}
150} // NAMESPACE
151
152#endif // FS_COLORTABLE_H
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.
QStringList struct_names
Eigen::VectorXi getLabelIds() const
Eigen::MatrixX4i getRGBAs() const
Eigen::MatrixXi table
QSharedPointer< const FsColortable > ConstSPtr
QStringList getNames() const
QSharedPointer< FsColortable > SPtr