Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::SliceNavigationHelper Namespace Reference

Functions

MITKCORE_EXPORT unsigned int SelectSliceByPoint (const TimeGeometry *timeGeometry, const Point3D &point)
 Select a specific slice from the given time geometry given a 3D point. More...
 
MITKCORE_EXPORT TimeGeometry::Pointer CreateOrientedTimeGeometry (const TimeGeometry *timeGeometry, AnatomicalPlane orientation, bool top, bool frontside, bool rotated)
 Create a new time geometry, which is oriented with the given plane orientation. More...
 
MITKCORE_EXPORT PlaneGeometryGetCurrentPlaneGeometry (const TimeGeometry *timeGeometry, TimePointType timePoint, unsigned int slicePosition)
 Extracts the plane geometry for the given time step and slice position. More...
 

Function Documentation

◆ CreateOrientedTimeGeometry()

MITKCORE_EXPORT TimeGeometry::Pointer mitk::SliceNavigationHelper::CreateOrientedTimeGeometry ( const TimeGeometry timeGeometry,
AnatomicalPlane  orientation,
bool  top,
bool  frontside,
bool  rotated 
)

Create a new time geometry, which is oriented with the given plane orientation.

The function uses the currently selected time point to retrieve the current base geometry from the given time geometry. A new SlicedGeometry3D is created and initialized with the given parameters and the extracted base geometry. This new SlicedGeometry3D is then used to replace the geometries of each time step of a cloned version of the given TimeGeometry. This allows to only replace the contained geometries for each time step, keeping the time steps (time point + time duration) from the original time geometry.

Parameters
timeGeometryThe TimeGeometry which should be used for cloning.
orientationThe AnatomicalPlane that specifies the new orientation of the time geometry.
topIf true, create the plane at top, otherwise at bottom.
frontsideDefines the side of the plane.
rotatedRotates the plane by 180 degree around its normal. s.a. PlaneGeometry::InitializeStandardPlane
Precondition
The given TimeGeometry must cover the currently selected time point. If not, an exception is thrown. If the given TimeGeomety is a nullptr, a nullptr is returned immediately.
Returns
The created geometry as TimeGeometry.

◆ GetCurrentPlaneGeometry()

MITKCORE_EXPORT PlaneGeometry* mitk::SliceNavigationHelper::GetCurrentPlaneGeometry ( const TimeGeometry timeGeometry,
TimePointType  timePoint,
unsigned int  slicePosition 
)

Extracts the plane geometry for the given time step and slice position.

The function uses the given time point to retrieve the current base geometry from the given time geometry. If this base geometry is a SlicedGeometry3D, the plane geometry of the given slice position is extracted and returned. If not, a nullptr is returned.

Parameters
timeGeometryThe TimeGeometry of which the plane geometry should be extracted
timePointThe time point to extract the current base geometry.
slicePositionThe slice position to extract the current plane geometry.
Precondition
The given TimeGeometry must cover the currently selected time point. If not, an exception is thrown. If the given TimeGeomety is a nullptr, a nullptr is returned immediately.
Returns
The extracted plane geometry as PlaneGeometry. Nullptr, if no SlicedGeometry3D was found for the given time step.

◆ SelectSliceByPoint()

MITKCORE_EXPORT unsigned int mitk::SliceNavigationHelper::SelectSliceByPoint ( const TimeGeometry timeGeometry,
const Point3D point 
)

Select a specific slice from the given time geometry given a 3D point.

The function uses the currently selected time point to retrieve the current base geometry from the given time geometry. If this base geometry is a SlicedGeometry3D, the best fitting slice is computed by projecting the point onto the plane geometry of this SlicedGeometry. The slice with the shortest distance to the point is returned as the selected slice.

Parameters
timeGeometryThe TimeGeometry of which the slice should be selected.
pointThe Point3D which is used to select the specific slice.
Precondition
The given TimeGeometry must cover the currently selected time point. If not, an exception is thrown. If the given TimeGeomety is a nullptr, -1 is returned.
Returns
The selected slice as unsigned int. If the computed slice is negative, "0" (zero) is returned as the selected slice.