v2.0.0
Loading...
Searching...
No Matches
fs_colortable.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FS_COLORTABLE_H
38#define FS_COLORTABLE_H
39
40//=============================================================================================================
41// FS INCLUDES
42//=============================================================================================================
43
44#include "fs_global.h"
45
46//=============================================================================================================
47// QT INCLUDES
48//=============================================================================================================
49
50#include <QString>
51#include <QStringList>
52#include <QSharedPointer>
53
54//=============================================================================================================
55// EIGEN INCLUDES
56//=============================================================================================================
57
58#include <Eigen/Core>
59
60//=============================================================================================================
61// DEFINE NAMESPACE FSLIB
62//=============================================================================================================
63
64namespace FSLIB
65{
66
67//=============================================================================================================
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
Fs library export/import macros.
#define FSSHARED_EXPORT
Definition fs_global.h:52
FreeSurfer surface and annotation I/O.
QStringList struct_names
Eigen::VectorXi getLabelIds() const
Eigen::MatrixX4i getRGBAs() const
Eigen::MatrixXi table
QSharedPointer< const FsColortable > ConstSPtr
QStringList getNames() const
QSharedPointer< FsColortable > SPtr