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//=============================================================================================================
74{
75public:
76 typedef QSharedPointer<FsColortable> SPtr;
77 typedef QSharedPointer<const FsColortable> ConstSPtr;
78
79 //=========================================================================================================
83 explicit FsColortable();
84
85 //=========================================================================================================
89 void clear();
90
91 //=========================================================================================================
97 inline Eigen::VectorXi getLabelIds() const;
98
99 //=========================================================================================================
105 inline QStringList getNames() const;
106
107 //=========================================================================================================
113 inline Eigen::MatrixX4i getRGBAs() const;
114
115public:
116 QString orig_tab;
117 qint32 numEntries;
118 QStringList struct_names;
119 Eigen::MatrixXi table;
120};
121
122//=============================================================================================================
123// INLINE DEFINITIONS
124//=============================================================================================================
125
126inline Eigen::VectorXi FsColortable::getLabelIds() const
127{
128 Eigen::VectorXi p_vecIds;
129 if (table.cols() == 5)
130 p_vecIds = table.block(0, 4, table.rows(), 1);
131
132 return p_vecIds;
133}
134
135//=============================================================================================================
136
137inline QStringList FsColortable::getNames() const
138{
139 return struct_names;
140}
141
142//=============================================================================================================
143
144inline Eigen::MatrixX4i FsColortable::getRGBAs() const
145{
146 Eigen::MatrixX4i p_matRGBAs;
147 if (table.cols() == 5)
148 p_matRGBAs = table.block(0, 0, table.rows(), 4);
149
150 return p_matRGBAs;
151}
152} // NAMESPACE
153
154#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