v2.0.0
Loading...
Searching...
No Matches
fs_atlas_lookup.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef FS_ATLAS_LOOKUP_H
36#define FS_ATLAS_LOOKUP_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "fs_global.h"
43
44//=============================================================================================================
45// EIGEN INCLUDES
46//=============================================================================================================
47
48#include <Eigen/Core>
49
50//=============================================================================================================
51// QT INCLUDES
52//=============================================================================================================
53
54#include <QString>
55#include <QStringList>
56#include <QMap>
57#include <QVector>
58
59//=============================================================================================================
60// DEFINE NAMESPACE FSLIB
61//=============================================================================================================
62
63namespace FSLIB
64{
65
66//=============================================================================================================
73{
74public:
75 //=========================================================================================================
80
81 //=========================================================================================================
87 bool load(const QString& sParcellationPath);
88
89 //=========================================================================================================
95 QString labelAtRas(const Eigen::Vector3f& ras) const;
96
97 //=========================================================================================================
103 QStringList labelsForPositions(const QVector<Eigen::Vector3f>& positions) const;
104
105 //=========================================================================================================
110 bool isLoaded() const;
111
112private:
113 QVector<int> m_voxelData;
114 int m_dimX = 0;
115 int m_dimY = 0;
116 int m_dimZ = 0;
117
118 Eigen::Matrix4f m_ras2vox;
119
120 QMap<int, QString> m_lookupTable;
121
122 bool m_loaded = false;
123
124 //=========================================================================================================
128 void initLookupTable();
129
130 //=========================================================================================================
136 Eigen::Vector3i rasToVoxel(const Eigen::Vector3f& ras) const;
137};
138
139} // namespace FSLIB
140
141#endif // FS_ATLAS_LOOKUP_H
Fs library export/import macros.
#define FSSHARED_EXPORT
Definition fs_global.h:52
FreeSurfer surface and annotation I/O.
QString labelAtRas(const Eigen::Vector3f &ras) const
Look up the anatomical label at a RAS coordinate.
bool isLoaded() const
Check whether a parcellation volume has been loaded.
bool load(const QString &sParcellationPath)
Load a FreeSurfer MGH/MGZ volume parcellation.
QStringList labelsForPositions(const QVector< Eigen::Vector3f > &positions) const
Look up labels for multiple RAS positions.