Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkAbstractTransformGeometry.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 mitkAbstractTransformGeometry_h
14 #define mitkAbstractTransformGeometry_h
15 
16 #include <mitkPlaneGeometry.h>
17 #include <MitkCoreExports.h>
18 
20 
21 class vtkAbstractTransform;
22 
23 namespace mitk
24 {
47  {
48  public:
50 
51  itkFactorylessNewMacro(Self);
52 
53  itkCloneMacro(Self);
54 
61  virtual vtkAbstractTransform *GetVtkAbstractTransform() const;
62 
71  itk::ModifiedTimeType GetMTime() const override;
72 
81  itkGetConstObjectMacro(Plane, PlaneGeometry);
82 
93  bool Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const override;
94 
104  bool Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const override;
105 
116  bool Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const override;
117 
127  void Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const override;
128 
137  bool Map(const mitk::Point3D &atPt3d_mm,
138  const mitk::Vector3D &vec3d_mm,
139  mitk::Vector2D &vec2d_mm) const override;
140 
148  void Map(const mitk::Point2D &atPt2d_mm,
149  const mitk::Vector2D &vec2d_mm,
150  mitk::Vector3D &vec3d_mm) const override;
151 
158  void IndexToWorld(const mitk::Point2D &pt_units, mitk::Point2D &pt_mm) const override;
159 
166  void WorldToIndex(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units) const override;
167 
174  void IndexToWorld(const mitk::Vector2D &vec_units, mitk::Vector2D &vec_mm) const override;
175 
182  void WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units) const override;
183 
194  bool IsAbove(const Point3D &pt3d_mm, bool considerBoundingBox = false) const override;
195 
205  virtual mitk::ScalarType GetParametricExtentInMM(int direction) const;
206 
212  virtual const itk::Transform<mitk::ScalarType, 3, 3> *GetParametricTransform() const;
213 
224  virtual void SetOversampling(mitk::ScalarType oversampling);
225 
234  virtual void CalculateFrameGeometry();
235 
246  virtual void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry);
247 
253  itkGetConstObjectMacro(ParametricBoundingBox, BoundingBox);
254 
261  const BoundingBox::BoundsArrayType &GetParametricBounds() const;
262 
270  mitk::ScalarType GetParametricExtent(int direction) const;
271 
272  protected:
275 
277 
278  //##Documentation
279  //## @brief Set the vtkAbstractTransform (stored in m_VtkAbstractTransform)
280  //##
281  //## Protected in this class, made public in ExternAbstractTransformGeometry.
282  virtual void SetVtkAbstractTransform(vtkAbstractTransform *aVtkAbstractTransform);
283 
284  //##Documentation
285  //## @brief Set the rectangular area that is used for transformation by
286  //## m_VtkAbstractTransform and therewith defines the 2D manifold described by
287  //## ExternAbstractTransformGeometry
288  //##
289  //## Protected in this class, made public in ExternAbstractTransformGeometry.
290  //## @note The bounds of the PlaneGeometry are used as the parametric bounds.
291  //## @note The PlaneGeometry is cloned, @em not linked/referenced.
292  virtual void SetPlane(const mitk::PlaneGeometry *aPlane);
293 
294  //##Documentation
295  //## @brief The rectangular area that is used for transformation by
296  //## m_VtkAbstractTransform and therewith defines the 2D manifold described by
297  //## AbstractTransformGeometry.
298  mitk::PlaneGeometry::Pointer m_Plane;
299 
301 
302  mitk::BaseGeometry::Pointer m_FrameGeometry;
303 
304  //##Documentation
305  //## @brief Set the parametric bounds
306  //##
307  //## Protected in this class, made public in some sub-classes, e.g.,
308  //## ExternAbstractTransformGeometry.
309  virtual void SetParametricBounds(const BoundingBox::BoundsArrayType &bounds);
310 
311  mutable mitk::BoundingBox::Pointer m_ParametricBoundingBox;
312 
313  //##Documentation
314  //## @brief PreSetSpacing
315  //##
316  //## These virtual function allows a different beahiour in subclasses.
317  //## Do implement them in every subclass of BaseGeometry. If not needed, use
318  //## {Superclass::PreSetSpacing();};
319  void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
320 
322  };
323 } // namespace mitk
324 #endif
#define MITKCORE_EXPORT
Geometry describing a curved 2D manifold in 3D space via a vtkAbstractTransform.
bool Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const override
Project a 3D vector onto the curved surface.
void WorldToIndex(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units) const override
Convert 2D world coordinates to 2D index coordinates via the internal plane.
mitk::ScalarType GetParametricExtent(int direction) const
Get the parametric extent in a given direction (in index/unit coordinates).
bool Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const override
Project a 3D point onto the curved surface.
virtual vtkAbstractTransform * GetVtkAbstractTransform() const
Get the underlying vtkAbstractTransform.
mitk::BoundingBox::Pointer m_ParametricBoundingBox
virtual void CalculateFrameGeometry()
Compute the frame geometry (IndexToWorldTransform + bounds) around the curved surface.
virtual void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry)
Set the frame geometry explicitly.
itk::VtkAbstractTransform< ScalarType >::Pointer m_ItkVtkAbstractTransform
void WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units) const override
Convert world coordinates (mm) of a 2D vector to continuous index coordinates.
virtual void SetPlane(const mitk::PlaneGeometry *aPlane)
Set the rectangular area that is used for transformation by m_VtkAbstractTransform and therewith defi...
mitkClassMacro(AbstractTransformGeometry, PlaneGeometry)
void IndexToWorld(const mitk::Vector2D &vec_units, mitk::Vector2D &vec_mm) const override
Convert 2D index coordinates of a vector to world coordinates (mm).
mitk::PlaneGeometry::Pointer m_Plane
The rectangular area that is used for transformation by m_VtkAbstractTransform and therewith defines ...
bool Map(const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec3d_mm, mitk::Vector2D &vec2d_mm) const override
Map a 3D vector at a given 3D point to a 2D parameter-space vector.
virtual void SetOversampling(mitk::ScalarType oversampling)
Multiply the parametric bounds by an oversampling factor.
void Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const override
Map a 2D parameter-space point to 3D world coordinates.
virtual void SetVtkAbstractTransform(vtkAbstractTransform *aVtkAbstractTransform)
Set the vtkAbstractTransform (stored in m_VtkAbstractTransform)
AbstractTransformGeometry(const AbstractTransformGeometry &other)
virtual mitk::ScalarType GetParametricExtentInMM(int direction) const
Get the parametric extent in mm for a given direction.
void Map(const mitk::Point2D &atPt2d_mm, const mitk::Vector2D &vec2d_mm, mitk::Vector3D &vec3d_mm) const override
Map a 2D parameter-space vector to a 3D world vector.
const BoundingBox::BoundsArrayType & GetParametricBounds() const
Get the parametric bounds array.
void IndexToWorld(const mitk::Point2D &pt_units, mitk::Point2D &pt_mm) const override
Convert 2D index coordinates to 2D world coordinates via the internal plane.
bool Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const override
Map a 3D world point onto the 2D parameter space.
itk::ModifiedTimeType GetMTime() const override
Get the modification time, accounting for the transform.
bool IsAbove(const Point3D &pt3d_mm, bool considerBoundingBox=false) const override
Determine whether a point is above the curved plane.
virtual void SetParametricBounds(const BoundingBox::BoundsArrayType &bounds)
Set the parametric bounds.
void PreSetSpacing(const mitk::Vector3D &aSpacing) override
PreSetSpacing.
virtual const itk::Transform< mitk::ScalarType, 3, 3 > * GetParametricTransform() const
Get the parametric transform (the ITK wrapper around the vtkAbstractTransform).
Abstract base class describing the geometry of a data object.
Describes the geometry of a plane object.
Bounding object representing a flat plane surface.
Definition: mitkPlane.h:34
Find image slices visible on a given plane.
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D bounding box type.
double ScalarType
Scalar type used throughout MITK for geometric computations.