Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::PlaneClipping Namespace Reference

Utility functions for plane clipping calculations. More...

Functions

static bool LineIntersectZero (vtkPoints *points, int p1, int p2, double *bounds)
 Internal helper method for intersection testing used only in CalculateClippedPlaneBounds(). More...
 
static bool CalculateClippedPlaneBounds (const BaseGeometry *boundingGeometry, const PlaneGeometry *planeGeometry, double *bounds)
 Calculate the bounding box of the resliced image. More...
 

Detailed Description

Utility functions for plane clipping calculations.

Function Documentation

◆ CalculateClippedPlaneBounds()

static bool mitk::PlaneClipping::CalculateClippedPlaneBounds ( const BaseGeometry *  boundingGeometry,
const PlaneGeometry *  planeGeometry,
double *  bounds 
)
static

Calculate the bounding box of the resliced image.

This is necessary for arbitrarily rotated planes in an image volume. A rotated plane (e.g. in swivel mode) will have a new bounding box, which needs to be calculated by clipping the bounding geometry edges against the plane.

Parameters
[in]boundingGeometryThe geometry defining the volume bounding box.
[in]planeGeometryThe plane geometry to clip against.
[out]boundsArray of 6 doubles receiving [xmin, xmax, ymin, ymax, zmin, zmax] in physical coordinates (mm), adjusted by plane spacing.
Returns
True if valid bounds were computed, false if the plane does not intersect the volume.

Definition at line 87 of file mitkPlaneClipping.h.

References mitk::BaseGeometry::GetBoundingBox(), mitk::BaseGeometry::GetImageGeometry(), mitk::BaseGeometry::GetSpacing(), mitk::BaseGeometry::GetVtkTransform(), and LineIntersectZero().

◆ LineIntersectZero()

static bool mitk::PlaneClipping::LineIntersectZero ( vtkPoints *  points,
int  p1,
int  p2,
double *  bounds 
)
static

Internal helper method for intersection testing used only in CalculateClippedPlaneBounds().

Tests whether the line segment between two points crosses the z=0 plane, and if so, updates the bounds with the intersection coordinates.

Parameters
[in]pointsVTK point set containing the coordinates.
[in]p1Index of the first point in the point set.
[in]p2Index of the second point in the point set.
[in,out]boundsArray of 6 doubles [xmin, xmax, ymin, ymax, zmin, zmax] updated with the intersection point if found.
Returns
True if an intersection with z=0 was found.

Definition at line 39 of file mitkPlaneClipping.h.

Referenced by CalculateClippedPlaneBounds().