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) |
| void | setSliceToWorld (const QImage &image, SliceOrientation orientation, int sliceIndex, const Eigen::Matrix4d &imageToWorld) |
| 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 78 of file sliceobject.h.
| SliceObject::SliceObject | ( | ) |
Definition at line 29 of file sliceobject.cpp.
|
static |
Generate quad index buffer: 2 triangles = 6 indices.
| [out] | indices | Output index data. |
Definition at line 243 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 210 of file sliceobject.cpp.
| const QImage & SliceObject::image | ( | ) | const |
Definition at line 134 of file sliceobject.cpp.
| float SliceObject::opacity | ( | ) | const |
Definition at line 203 of file sliceobject.cpp.
| SliceOrientation SliceObject::orientation | ( | ) | const |
Definition at line 120 of file sliceobject.cpp.
| void SliceObject::setOpacity | ( | float | opacity | ) |
| [in] | opacity | Slice transparency [0,1]. |
Definition at line 196 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 39 of file sliceobject.cpp.
| void SliceObject::setSliceToWorld | ( | const QImage & | image, |
| SliceOrientation | orientation, | ||
| int | sliceIndex, | ||
| const Eigen::Matrix4d & | imageToWorld ) |
Set the slice image data with an explicit image-to-world transform.
| [in] | image | Greyscale slice image (QImage::Format_Grayscale8 or 16). |
| [in] | orientation | Anatomical orientation of the slice. |
| [in] | sliceIndex | Index along the perpendicular voxel axis. |
| [in] | imageToWorld | 4x4 transform from image coordinates (column, row, 0) to RAS. |
Definition at line 95 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 174 of file sliceobject.cpp.
| int SliceObject::sliceIndex | ( | ) | const |
Definition at line 127 of file sliceobject.cpp.
| QMatrix4x4 SliceObject::sliceToWorld | ( | ) | const |
Definition at line 141 of file sliceobject.cpp.
| float SliceObject::windowCenter | ( | ) | const |
Definition at line 182 of file sliceobject.cpp.
| float SliceObject::windowWidth | ( | ) | const |
Definition at line 189 of file sliceobject.cpp.