v2.0.0
Loading...
Searching...
No Matches
sliceobject.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef SLICEOBJECT_H
36#define SLICEOBJECT_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "../disp3D_global.h"
43
44//=============================================================================================================
45// EIGEN INCLUDES
46//=============================================================================================================
47
48#include <Eigen/Core>
49#include <Eigen/Geometry>
50
51//=============================================================================================================
52// QT INCLUDES
53//=============================================================================================================
54
55#include <QImage>
56#include <QMatrix4x4>
57#include <QVector>
58
59//=============================================================================================================
60// DEFINE NAMESPACE DISP3DLIB
61//=============================================================================================================
62
63namespace DISP3DLIB
64{
65
66//=============================================================================================================
75
76//=============================================================================================================
85{
86public:
88
89 //=========================================================================================================
98 void setSlice(const QImage& image,
100 int sliceIndex,
101 const Eigen::Matrix4d& voxelToWorld);
102
103 //=========================================================================================================
108
109 //=========================================================================================================
113 int sliceIndex() const;
114
115 //=========================================================================================================
119 const QImage& image() const;
120
121 //=========================================================================================================
125 QMatrix4x4 sliceToWorld() const;
126
127 //=========================================================================================================
134 void setWindowLevel(float center, float width);
135
136 //=========================================================================================================
140 float windowCenter() const;
141
142 //=========================================================================================================
146 float windowWidth() const;
147
148 //=========================================================================================================
152 void setOpacity(float opacity);
153
154 //=========================================================================================================
158 float opacity() const;
159
160 //=========================================================================================================
166 void generateQuadVertices(QVector<float>& vertices) const;
167
168 //=========================================================================================================
174 static void generateQuadIndices(QVector<unsigned int>& indices);
175
176private:
177 QImage m_image;
179 int m_sliceIndex = 0;
180 Eigen::Matrix4d m_voxelToWorld = Eigen::Matrix4d::Identity();
181 float m_windowCenter = 0.5f;
182 float m_windowWidth = 1.0f;
183 float m_opacity = 1.0f;
184
185 // Cached corners in world coordinates (computed in setSlice)
186 Eigen::Vector3d m_corner00; // (0,0) UV corner
187 Eigen::Vector3d m_corner10; // (1,0) UV corner
188 Eigen::Vector3d m_corner01; // (0,1) UV corner
189 Eigen::Vector3d m_corner11; // (1,1) UV corner
190};
191
192} // namespace DISP3DLIB
193
194#endif // SLICEOBJECT_H
disp3D library export/import macros.
#define DISP3DSHARED_EXPORT
3-D brain visualisation using the Qt RHI rendering backend.
SliceOrientation
Orientation for an orthogonal MRI slice.
Definition sliceobject.h:70
float windowCenter() const
const QImage & image() const
void setWindowLevel(float center, float width)
static void generateQuadIndices(QVector< unsigned int > &indices)
float windowWidth() const
QMatrix4x4 sliceToWorld() const
void setSlice(const QImage &image, SliceOrientation orientation, int sliceIndex, const Eigen::Matrix4d &voxelToWorld)
void generateQuadVertices(QVector< float > &vertices) const
SliceOrientation orientation() const
void setOpacity(float opacity)