v2.0.0
Loading...
Searching...
No Matches
DISP3DLIB::SliceObject Class Reference

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)

Detailed Description

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.

Constructor & Destructor Documentation

◆ SliceObject()

SliceObject::SliceObject ( )

Definition at line 51 of file sliceobject.cpp.

Member Function Documentation

◆ generateQuadIndices()

void SliceObject::generateQuadIndices ( QVector< unsigned int > & indices)
static

Generate quad index buffer: 2 triangles = 6 indices.

Parameters
[out]indicesOutput index data.

Definition at line 240 of file sliceobject.cpp.

◆ generateQuadVertices()

void SliceObject::generateQuadVertices ( QVector< float > & vertices) const

Generate quad vertex buffer: 4 vertices × (3 pos + 2 UV) = 20 floats.

Parameters
[out]verticesOutput vertex data.

Definition at line 207 of file sliceobject.cpp.

◆ image()

const QImage & SliceObject::image ( ) const
Returns
The slice image.

Definition at line 131 of file sliceobject.cpp.

◆ opacity()

float SliceObject::opacity ( ) const
Returns
Current opacity.

Definition at line 200 of file sliceobject.cpp.

◆ orientation()

SliceOrientation SliceObject::orientation ( ) const
Returns
Current slice orientation.

Definition at line 117 of file sliceobject.cpp.

◆ setOpacity()

void SliceObject::setOpacity ( float opacity)
Parameters
[in]opacitySlice transparency [0,1].

Definition at line 193 of file sliceobject.cpp.

◆ setSlice()

void SliceObject::setSlice ( const QImage & image,
SliceOrientation orientation,
int sliceIndex,
const Eigen::Matrix4d & voxelToWorld )

Set the slice image data and orientation.

Parameters
[in]imageGreyscale slice image (QImage::Format_Grayscale8 or 16).
[in]orientationAxial, Sagittal, or Coronal.
[in]sliceIndexIndex along the perpendicular axis (voxel units).
[in]voxelToWorld4×4 voxel-to-RAS transform from the MRI header.

Definition at line 61 of file sliceobject.cpp.

◆ setWindowLevel()

void SliceObject::setWindowLevel ( float center,
float width )

Intensity windowing parameters for the fragment shader.

Parameters
[in]centerWindow center in normalised intensity [0,1].
[in]widthWindow width in normalised intensity [0,1].

Definition at line 171 of file sliceobject.cpp.

◆ sliceIndex()

int SliceObject::sliceIndex ( ) const
Returns
Current slice index (voxel units along the perpendicular axis).

Definition at line 124 of file sliceobject.cpp.

◆ sliceToWorld()

QMatrix4x4 SliceObject::sliceToWorld ( ) const
Returns
4×4 matrix that maps the unit quad [0,1]² into world (RAS) coordinates.

Definition at line 138 of file sliceobject.cpp.

◆ windowCenter()

float SliceObject::windowCenter ( ) const
Returns
Window center.

Definition at line 179 of file sliceobject.cpp.

◆ windowWidth()

float SliceObject::windowWidth ( ) const
Returns
Window width.

Definition at line 186 of file sliceobject.cpp.


The documentation for this class was generated from the following files: