Medical Imaging Interaction Toolkit  2018.4.99-c0f884b2
Medical Imaging Interaction Toolkit
mitk::ClippedSurfaceBoundsCalculator Class Reference

#include <mitkClippedSurfaceBoundsCalculator.h>

Collaboration diagram for mitk::ClippedSurfaceBoundsCalculator:

Public Types

typedef std::vector< mitk::Point3DPointListType
 
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)
 
 ClippedSurfaceBoundsCalculator (const mitk::BaseGeometry *geometry, mitk::Image::Pointer image)
 
 ClippedSurfaceBoundsCalculator (const PointListType pointlist, mitk::Image::Pointer image)
 
void InitializeOutput ()
 
virtual ~ClippedSurfaceBoundsCalculator ()
 
void SetInput (const mitk::PlaneGeometry *geometry, mitk::Image *image)
 
void SetInput (const mitk::BaseGeometry *geometry, mitk::Image *image)
 
void SetInput (const PointListType pointlist, mitk::Image *image)
 
void Update ()
 Request calculation. More...
 
OutputType GetMinMaxSpatialDirectionX ()
 What X coordinates (slice indices) are cut/visible in given plane. More...
 
OutputType GetMinMaxSpatialDirectionY ()
 What Y coordinates (slice indices) are cut/visible in given plane. More...
 
OutputType GetMinMaxSpatialDirectionZ ()
 What Z coordinates (slice indices) are cut/visible in given plane. More...
 

Protected Member Functions

void CalculateIntersectionPoints (const mitk::PlaneGeometry *geometry)
 
void CalculateIntersectionPoints (PointListType pointList)
 
void EnforceImageBounds ()
 Clips the resulting index-coordinates to make sure they do not exceed the imagebounds. More...
 

Protected Attributes

mitk::PlaneGeometry::ConstPointer m_PlaneGeometry
 
mitk::BaseGeometry::ConstPointer m_Geometry3D
 
mitk::Image::Pointer m_Image
 
std::vector< mitk::Point3Dm_ObjectPointsInWorldCoordinates
 
std::vector< OutputTypem_MinMaxOutput
 

Detailed Description

Definition at line 39 of file mitkClippedSurfaceBoundsCalculator.h.

Member Typedef Documentation

◆ OutputType

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

Definition at line 72 of file mitkClippedSurfaceBoundsCalculator.h.

◆ PointListType

Constructor & Destructor Documentation

◆ ClippedSurfaceBoundsCalculator() [1/3]

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

Definition at line 17 of file mitkClippedSurfaceBoundsCalculator.cpp.

References InitializeOutput(), and SetInput().

◆ ClippedSurfaceBoundsCalculator() [2/3]

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

Definition at line 26 of file mitkClippedSurfaceBoundsCalculator.cpp.

References InitializeOutput(), and SetInput().

◆ ClippedSurfaceBoundsCalculator() [3/3]

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

◆ ~ClippedSurfaceBoundsCalculator()

mitk::ClippedSurfaceBoundsCalculator::~ClippedSurfaceBoundsCalculator ( )
virtual

Definition at line 55 of file mitkClippedSurfaceBoundsCalculator.cpp.

Member Function Documentation

◆ CalculateIntersectionPoints() [1/2]

◆ CalculateIntersectionPoints() [2/2]

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

Definition at line 246 of file mitkClippedSurfaceBoundsCalculator.cpp.

References m_Image, m_MinMaxOutput, and ROUND_P.

◆ EnforceImageBounds()

void mitk::ClippedSurfaceBoundsCalculator::EnforceImageBounds ( )
protected

Clips the resulting index-coordinates to make sure they do not exceed the imagebounds.

Definition at line 275 of file mitkClippedSurfaceBoundsCalculator.cpp.

References m_Image, m_MinMaxOutput, max(), and min().

Referenced by CalculateIntersectionPoints(), and Update().

◆ GetMinMaxSpatialDirectionX()

mitk::ClippedSurfaceBoundsCalculator::OutputType mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionX ( )

What X coordinates (slice indices) are cut/visible in given plane.

Definition at line 92 of file mitkClippedSurfaceBoundsCalculator.cpp.

References m_MinMaxOutput.

Referenced by CheckIntersectionWithPointCloud().

◆ GetMinMaxSpatialDirectionY()

mitk::ClippedSurfaceBoundsCalculator::OutputType mitk::ClippedSurfaceBoundsCalculator::GetMinMaxSpatialDirectionY ( )

What Y coordinates (slice indices) are cut/visible in given plane.

Definition at line 97 of file mitkClippedSurfaceBoundsCalculator.cpp.

References m_MinMaxOutput.

Referenced by CheckIntersectionWithRotatedGeometry90().

◆ GetMinMaxSpatialDirectionZ()

◆ InitializeOutput()

void mitk::ClippedSurfaceBoundsCalculator::InitializeOutput ( )

Definition at line 44 of file mitkClippedSurfaceBoundsCalculator.cpp.

References m_MinMaxOutput, max(), and min().

Referenced by ClippedSurfaceBoundsCalculator().

◆ SetInput() [1/3]

◆ SetInput() [2/3]

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

◆ SetInput() [3/3]

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

◆ 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

Definition at line 107 of file mitkClippedSurfaceBoundsCalculator.cpp.

References CalculateIntersectionPoints(), EnforceImageBounds(), mitk::SlicedGeometry3D::GetSlices(), m_Geometry3D, m_MinMaxOutput, m_ObjectPointsInWorldCoordinates, m_PlaneGeometry, max(), and min().

Referenced by CheckIntersectionPointsOfTwoGeometry3D(), CheckIntersectionWithPointCloud(), CheckIntersectionWithRotatedGeometry(), CheckIntersectionWithRotatedGeometry90(), CheckPlanesInsideBoundingBox(), CheckPlanesInsideBoundingBoxOnlyOnOneSlice(), and CheckPlanesOutsideOfBoundingBox().

Member Data Documentation

◆ m_Geometry3D

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

Definition at line 100 of file mitkClippedSurfaceBoundsCalculator.h.

Referenced by SetInput(), and Update().

◆ m_Image

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

◆ m_MinMaxOutput

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

◆ m_ObjectPointsInWorldCoordinates

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

◆ m_PlaneGeometry

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

Definition at line 99 of file mitkClippedSurfaceBoundsCalculator.h.

Referenced by SetInput(), and Update().


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