Data model for a single 2-D MRI volume slice. More...
#include <sliceobject.h>
Public Member Functions | |
| SliceObject () | |
| void | setSlice (const QImage &image, SliceOrientation orientation, int sliceIndex, const Eigen::Matrix4d &voxelToWorld) |
| SliceOrientation | orientation () const |
| int | sliceIndex () const |
| const QImage & | image () const |
| QMatrix4x4 | sliceToWorld () const |
| void | setWindowLevel (float center, float width) |
| float | windowCenter () const |
| float | windowWidth () const |
| void | setOpacity (float opacity) |
| float | opacity () const |
| void | generateQuadVertices (QVector< float > &vertices) const |
Static Public Member Functions | |
| static void | generateQuadIndices (QVector< unsigned int > &indices) |
Data model for a single 2-D MRI volume slice.
Holds the greyscale slice image, orientation metadata, and the slice-to-world transform. Generates a textured quad and vertex/UV data for upload to a QRhi renderer via the slice.vert / slice.frag shaders.
Definition at line 84 of file sliceobject.h.
| SliceObject::SliceObject | ( | ) |
Definition at line 51 of file sliceobject.cpp.
|
static |
Generate quad index buffer: 2 triangles = 6 indices.
| [out] | indices | Output index data. |
Definition at line 240 of file sliceobject.cpp.
| void SliceObject::generateQuadVertices | ( | QVector< float > & | vertices | ) | const |
Generate quad vertex buffer: 4 vertices × (3 pos + 2 UV) = 20 floats.
| [out] | vertices | Output vertex data. |
Definition at line 207 of file sliceobject.cpp.
| const QImage & SliceObject::image | ( | ) | const |
Definition at line 131 of file sliceobject.cpp.
| float SliceObject::opacity | ( | ) | const |
Definition at line 200 of file sliceobject.cpp.
| SliceOrientation SliceObject::orientation | ( | ) | const |
Definition at line 117 of file sliceobject.cpp.
| void SliceObject::setOpacity | ( | float | opacity | ) |
| [in] | opacity | Slice transparency [0,1]. |
Definition at line 193 of file sliceobject.cpp.
| void SliceObject::setSlice | ( | const QImage & | image, |
| SliceOrientation | orientation, | ||
| int | sliceIndex, | ||
| const Eigen::Matrix4d & | voxelToWorld ) |
Set the slice image data and orientation.
| [in] | image | Greyscale slice image (QImage::Format_Grayscale8 or 16). |
| [in] | orientation | Axial, Sagittal, or Coronal. |
| [in] | sliceIndex | Index along the perpendicular axis (voxel units). |
| [in] | voxelToWorld | 4×4 voxel-to-RAS transform from the MRI header. |
Definition at line 61 of file sliceobject.cpp.
| void SliceObject::setWindowLevel | ( | float | center, |
| float | width ) |
Intensity windowing parameters for the fragment shader.
| [in] | center | Window center in normalised intensity [0,1]. |
| [in] | width | Window width in normalised intensity [0,1]. |
Definition at line 171 of file sliceobject.cpp.
| int SliceObject::sliceIndex | ( | ) | const |
Definition at line 124 of file sliceobject.cpp.
| QMatrix4x4 SliceObject::sliceToWorld | ( | ) | const |
Definition at line 138 of file sliceobject.cpp.
| float SliceObject::windowCenter | ( | ) | const |
Definition at line 179 of file sliceobject.cpp.
| float SliceObject::windowWidth | ( | ) | const |
Definition at line 186 of file sliceobject.cpp.