Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkClippedSurfaceBoundsCalculator.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkClippedSurfaceBoundsCalculator_h
14 #define mitkClippedSurfaceBoundsCalculator_h
15 
16 #include <mitkImage.h>
17 #include <mitkPlaneGeometry.h>
18 #include <vector>
19 
39 namespace mitk
40 {
42  {
43  public:
45  typedef std::vector<mitk::Point3D> PointListType;
46 
52  ClippedSurfaceBoundsCalculator(const mitk::PlaneGeometry *geometry = nullptr, mitk::Image::Pointer image = nullptr);
53 
59  ClippedSurfaceBoundsCalculator(const mitk::BaseGeometry *geometry, mitk::Image::Pointer image);
60 
66  ClippedSurfaceBoundsCalculator(const PointListType pointlist, mitk::Image::Pointer image);
67 
70 
72 
78  void SetInput(const mitk::PlaneGeometry *geometry, mitk::Image *image);
79 
85  void SetInput(const mitk::BaseGeometry *geometry, mitk::Image *image);
86 
92  void SetInput(const PointListType pointlist, mitk::Image *image);
93 
105  void Update();
106 
110  typedef std::pair<int, int> OutputType;
111 
117 
123 
129 
130  protected:
136 
142 
147 
148  mitk::PlaneGeometry::ConstPointer m_PlaneGeometry;
149  mitk::BaseGeometry::ConstPointer m_Geometry3D;
150  mitk::Image::Pointer m_Image;
151  std::vector<mitk::Point3D> m_ObjectPointsInWorldCoordinates;
152  std::vector<OutputType> m_MinMaxOutput;
153  };
154 
155 } // namespace mitk
156 
157 #endif
#define MITKCORE_EXPORT
Abstract base class describing the geometry of a data object.
void EnforceImageBounds()
Clamp the resulting index coordinates so they do not exceed the image bounds.
mitk::PlaneGeometry::ConstPointer m_PlaneGeometry
The input plane geometry (if set).
ClippedSurfaceBoundsCalculator(const mitk::PlaneGeometry *geometry=nullptr, mitk::Image::Pointer image=nullptr)
Construct from a PlaneGeometry and image.
mitk::Image::Pointer m_Image
The image whose bounds are calculated.
OutputType GetMinMaxSpatialDirectionY()
Get the min/max slice indices visible in the Y direction.
std::pair< int, int > OutputType
Minimum (first) and maximum (second) slice index.
ClippedSurfaceBoundsCalculator(const mitk::BaseGeometry *geometry, mitk::Image::Pointer image)
Construct from a BaseGeometry (e.g. SlicedGeometry3D) and image.
void CalculateIntersectionPoints(const mitk::PlaneGeometry *geometry)
Calculate intersection points of the image bounding box edges with the given plane.
void SetInput(const mitk::BaseGeometry *geometry, mitk::Image *image)
Set a BaseGeometry and image as input.
void SetInput(const mitk::PlaneGeometry *geometry, mitk::Image *image)
Set a PlaneGeometry and image as input.
void SetInput(const PointListType pointlist, mitk::Image *image)
Set a list of world-coordinate points and image as input.
std::vector< mitk::Point3D > m_ObjectPointsInWorldCoordinates
World-coordinate points (if set).
OutputType GetMinMaxSpatialDirectionZ()
Get the min/max slice indices visible in the Z direction.
void InitializeOutput()
Reset the output min/max indices to their initial (invalid) state.
ClippedSurfaceBoundsCalculator(const PointListType pointlist, mitk::Image::Pointer image)
Construct from a list of world-coordinate points and image.
std::vector< mitk::Point3D > PointListType
List of 3D world-coordinate points.
void Update()
Request calculation.
mitk::BaseGeometry::ConstPointer m_Geometry3D
The input 3D geometry (if set).
std::vector< OutputType > m_MinMaxOutput
Min/max slice index results for each axis.
OutputType GetMinMaxSpatialDirectionX()
Get the min/max slice indices visible in the X direction.
void CalculateIntersectionPoints(PointListType pointList)
Calculate bounding slice indices from a list of world-coordinate points.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Describes the geometry of a plane object.
Find image slices visible on a given plane.