Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ClippedSurfaceBoundsCalculator Class Reference

#include <mitkClippedSurfaceBoundsCalculator.h>

Collaboration diagram for mitk::ClippedSurfaceBoundsCalculator:

Public Types

typedef std::vector< mitk::Point3D > PointListType
 List of 3D world-coordinate points. More...
 
typedef std::pair< int, int > OutputType
 Minimum (first) and maximum (second) slice index. More...
 

Public Member Functions

 ClippedSurfaceBoundsCalculator (const mitk::PlaneGeometry *geometry=nullptr, mitk::Image::Pointer image=nullptr)
 Construct from a PlaneGeometry and image. More...
 
 ClippedSurfaceBoundsCalculator (const mitk::BaseGeometry *geometry, mitk::Image::Pointer image)
 Construct from a BaseGeometry (e.g. SlicedGeometry3D) and image. More...
 
 ClippedSurfaceBoundsCalculator (const PointListType pointlist, mitk::Image::Pointer image)
 Construct from a list of world-coordinate points and image. More...
 
void InitializeOutput ()
 Reset the output min/max indices to their initial (invalid) state. More...
 
virtual ~ClippedSurfaceBoundsCalculator ()
 
void SetInput (const mitk::PlaneGeometry *geometry, mitk::Image *image)
 Set a PlaneGeometry and image as input. More...
 
void SetInput (const mitk::BaseGeometry *geometry, mitk::Image *image)
 Set a BaseGeometry and image as input. More...
 
void SetInput (const PointListType pointlist, mitk::Image *image)
 Set a list of world-coordinate points and image as input. More...
 
void Update ()
 Request calculation. More...
 
OutputType GetMinMaxSpatialDirectionX ()
 Get the min/max slice indices visible in the X direction. More...
 
OutputType GetMinMaxSpatialDirectionY ()
 Get the min/max slice indices visible in the Y direction. More...
 
OutputType GetMinMaxSpatialDirectionZ ()
 Get the min/max slice indices visible in the Z direction. More...
 

Protected Member Functions

void CalculateIntersectionPoints (const mitk::PlaneGeometry *geometry)
 Calculate intersection points of the image bounding box edges with the given plane. More...
 
void CalculateIntersectionPoints (PointListType pointList)
 Calculate bounding slice indices from a list of world-coordinate points. More...
 
void EnforceImageBounds ()
 Clamp the resulting index coordinates so they do not exceed the image bounds. More...
 

Protected Attributes

mitk::PlaneGeometry::ConstPointer m_PlaneGeometry
 The input plane geometry (if set). More...
 
mitk::BaseGeometry::ConstPointer m_Geometry3D
 The input 3D geometry (if set). More...
 
mitk::Image::Pointer m_Image
 The image whose bounds are calculated. More...
 
std::vector< mitk::Point3D > m_ObjectPointsInWorldCoordinates
 World-coordinate points (if set). More...
 
std::vector< OutputType > m_MinMaxOutput
 Min/max slice index results for each axis. More...
 

Detailed Description

Definition at line 41 of file mitkClippedSurfaceBoundsCalculator.h.

Member Typedef Documentation

◆ OutputType

Minimum (first) and maximum (second) slice index.

Definition at line 110 of file mitkClippedSurfaceBoundsCalculator.h.

◆ PointListType

List of 3D world-coordinate points.

Definition at line 45 of file mitkClippedSurfaceBoundsCalculator.h.

Constructor & Destructor Documentation

◆ ClippedSurfaceBoundsCalculator() [1/3]

mitk::ClippedSurfaceBoundsCalculator::ClippedSurfaceBoundsCalculator ( const mitk::PlaneGeometry *  geometry = nullptr,
mitk::Image::Pointer  image = nullptr 
)

Construct from a PlaneGeometry and image.

Parameters
geometryThe clipping plane (may be nullptr).
imageThe image whose slice bounds are computed (may be nullptr).

◆ ClippedSurfaceBoundsCalculator() [2/3]

mitk::ClippedSurfaceBoundsCalculator::ClippedSurfaceBoundsCalculator ( const mitk::BaseGeometry *  geometry,
mitk::Image::Pointer  image 
)

Construct from a BaseGeometry (e.g. SlicedGeometry3D) and image.

Parameters
geometryThe 3D geometry defining the clipping volume.
imageThe image whose slice bounds are computed.

◆ ClippedSurfaceBoundsCalculator() [3/3]

mitk::ClippedSurfaceBoundsCalculator::ClippedSurfaceBoundsCalculator ( const PointListType  pointlist,
mitk::Image::Pointer  image 
)

Construct from a list of world-coordinate points and image.

Parameters
pointlistPoints whose bounding slice indices are determined.
imageThe image whose slice bounds are computed.

◆ ~ClippedSurfaceBoundsCalculator()

virtual mitk::ClippedSurfaceBoundsCalculator::~ClippedSurfaceBoundsCalculator ( )
virtual

Member Function Documentation

◆ CalculateIntersectionPoints() [1/2]

void mitk::ClippedSurfaceBoundsCalculator::CalculateIntersectionPoints ( const mitk::PlaneGeometry *  geometry)
protected

Calculate intersection points of the image bounding box edges with the given plane.

Parameters
geometryThe plane geometry to intersect with.

◆ CalculateIntersectionPoints() [2/2]

void mitk::ClippedSurfaceBoundsCalculator::CalculateIntersectionPoints ( PointListType  pointList)
protected

Calculate bounding slice indices from a list of world-coordinate points.

Parameters
pointListThe points to convert to index coordinates.

◆ EnforceImageBounds()

void mitk::ClippedSurfaceBoundsCalculator::EnforceImageBounds ( )
protected

Clamp the resulting index coordinates so they do not exceed the image bounds.

◆ GetMinMaxSpatialDirectionX()

OutputType mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionX ( )

Get the min/max slice indices visible in the X direction.

Returns
A pair of (minimum, maximum) slice index in X.

◆ GetMinMaxSpatialDirectionY()

OutputType mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionY ( )

Get the min/max slice indices visible in the Y direction.

Returns
A pair of (minimum, maximum) slice index in Y.

◆ GetMinMaxSpatialDirectionZ()

OutputType mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionZ ( )

Get the min/max slice indices visible in the Z direction.

Returns
A pair of (minimum, maximum) slice index in Z.

◆ InitializeOutput()

void mitk::ClippedSurfaceBoundsCalculator::InitializeOutput ( )

Reset the output min/max indices to their initial (invalid) state.

◆ SetInput() [1/3]

void mitk::ClippedSurfaceBoundsCalculator::SetInput ( const mitk::BaseGeometry *  geometry,
mitk::Image *  image 
)

Set a BaseGeometry and image as input.

Parameters
geometryThe 3D geometry defining the clipping volume.
imageThe image whose slice bounds are computed.

◆ SetInput() [2/3]

void mitk::ClippedSurfaceBoundsCalculator::SetInput ( const mitk::PlaneGeometry *  geometry,
mitk::Image *  image 
)

Set a PlaneGeometry and image as input.

Parameters
geometryThe clipping plane.
imageThe image whose slice bounds are computed.

◆ SetInput() [3/3]

void mitk::ClippedSurfaceBoundsCalculator::SetInput ( const PointListType  pointlist,
mitk::Image *  image 
)

Set a list of world-coordinate points and image as input.

Parameters
pointlistPoints whose bounding slice indices are determined.
imageThe image whose slice bounds are computed.

◆ Update()

void mitk::ClippedSurfaceBoundsCalculator::Update ( )

Request calculation.

How cut/visible slice indices are determined:

  1. construct a bounding box of the image. This is the box that connect the outer voxel centers(!).
  2. check the edges of this box.
  3. intersect each edge with the plane geometry
    • if the intersection point is within the image box, we update the visible/cut slice indices for all dimensions.
    • else we ignore the cut

Member Data Documentation

◆ m_Geometry3D

mitk::BaseGeometry::ConstPointer mitk::ClippedSurfaceBoundsCalculator::m_Geometry3D
protected

The input 3D geometry (if set).

Definition at line 149 of file mitkClippedSurfaceBoundsCalculator.h.

◆ m_Image

mitk::Image::Pointer mitk::ClippedSurfaceBoundsCalculator::m_Image
protected

The image whose bounds are calculated.

Definition at line 150 of file mitkClippedSurfaceBoundsCalculator.h.

◆ m_MinMaxOutput

std::vector<OutputType> mitk::ClippedSurfaceBoundsCalculator::m_MinMaxOutput
protected

Min/max slice index results for each axis.

Definition at line 152 of file mitkClippedSurfaceBoundsCalculator.h.

◆ m_ObjectPointsInWorldCoordinates

std::vector<mitk::Point3D> mitk::ClippedSurfaceBoundsCalculator::m_ObjectPointsInWorldCoordinates
protected

World-coordinate points (if set).

Definition at line 151 of file mitkClippedSurfaceBoundsCalculator.h.

◆ m_PlaneGeometry

mitk::PlaneGeometry::ConstPointer mitk::ClippedSurfaceBoundsCalculator::m_PlaneGeometry
protected

The input plane geometry (if set).

Definition at line 148 of file mitkClippedSurfaceBoundsCalculator.h.


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