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

Standard three-dimensional geometry. More...

#include <mitkGeometry3D.h>

Inheritance diagram for mitk::Geometry3D:
Collaboration diagram for mitk::Geometry3D:

Public Types

typedef itk::QuaternionRigidTransform< ScalarType > QuaternionTransformType
 Quaternion rigid transform type (for rotation representations). More...
 
typedef QuaternionTransformType::VnlQuaternionType VnlQuaternionType
 VNL quaternion type derived from QuaternionTransformType. More...
 
- Public Types inherited from mitk::BaseGeometry
typedef GeometryTransformHolder::TransformType TransformType
 Affine transform type used for index-to-world mapping. More...
 
typedef itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBoxType
 3D bounding box type parameterized with ScalarType. More...
 
typedef BoundingBoxType::BoundsArrayType BoundsArrayType
 Fixed-size array of six ScalarType values representing axis-aligned bounds [xmin,xmax,ymin,ymax,zmin,zmax]. More...
 
typedef BoundingBoxType::Pointer BoundingBoxPointer
 Smart-pointer type for BoundingBoxType. More...
 

Public Member Functions

 mitkClassMacro (Geometry3D, mitk::BaseGeometry)
 
 mitkNewMacro1Param (Self, const Self &)
 
Pointer Clone () const
 
- Public Member Functions inherited from mitk::BaseGeometry
 mitkClassMacroItkParent (BaseGeometry, itk::Object)
 
Pointer Clone () const
 
Point3D GetOrigin () const
 Get the origin of the geometry in world coordinates (mm). More...
 
void SetOrigin (const Point3D &origin)
 Set the origin of the geometry in world coordinates (mm). More...
 
mitk::Vector3D GetSpacing () const
 Get the spacing (voxel size) in mm per unit for each axis. More...
 
void SetSpacing (const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
 Set the spacing (voxel size) for each axis. More...
 
VnlVector GetOriginVnl () const
 Get the origin as a VNL vector. More...
 
virtual unsigned int GetFrameOfReferenceID () const
 Get the DICOM FrameOfReferenceID referring to the world coordinate system. More...
 
virtual void SetFrameOfReferenceID (unsigned int _arg)
 Set the DICOM FrameOfReferenceID referring to the world coordinate system. More...
 
virtual unsigned long GetIndexToWorldTransformLastModified () const
 Get the last-modified timestamp of the IndexToWorldTransform. More...
 
void Modified () const override
 Overloaded Modified() to support the ModifiedLock mechanism. More...
 
virtual bool IsValid () const
 Check whether this geometry is in a valid state. More...
 
void Initialize ()
 Initialize the geometry to default values. More...
 
void InitializeGeometry (Self *newGeometry) const
 Copy the essential geometry properties into another instance. More...
 
mitk::AffineTransform3D * GetIndexToWorldTransform ()
 Get the affine transform that maps index coordinates to world coordinates. More...
 
const mitk::AffineTransform3D * GetIndexToWorldTransform () const
 Get the affine transform that maps index coordinates to world coordinates (const). More...
 
void SetIndexToWorldTransform (mitk::AffineTransform3D *transform)
 Set the affine transform for index-to-world coordinate mapping. More...
 
void SetIndexToWorldTransformByVtkMatrix (vtkMatrix4x4 *vtkmatrix)
 Set the IndexToWorldTransform via a vtkMatrix4x4. More...
 
void SetIndexToWorldTransformWithoutChangingSpacing (mitk::AffineTransform3D *transform)
 Set the IndexToWorldTransform while preserving the current spacing. More...
 
void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing (vtkMatrix4x4 *vtkmatrix)
 Set the IndexToWorldTransform via a vtkMatrix4x4 while preserving spacing. More...
 
vtkMatrix4x4 * GetVtkMatrix ()
 Get the IndexToWorldTransform as a 4x4 VTK matrix. More...
 
const vtkMatrix4x4 * GetVtkMatrix () const
 Get the IndexToWorldTransform as a 4x4 VTK matrix (const). More...
 
vtkLinearTransform * GetVtkTransform () const
 Get the IndexToWorldTransform as a vtkLinearTransform. More...
 
void SetIdentity ()
 Reset the geometry to identity. More...
 
void Compose (const TransformType *other, bool pre=false)
 Compose the IndexToWorldTransform with another transform. More...
 
void Compose (const vtkMatrix4x4 *vtkmatrix, bool pre=false)
 Compose the IndexToWorldTransform with a vtkMatrix4x4. More...
 
void Translate (const Vector3D &vector)
 Translate the origin by a given vector. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an affine operation (translate, rotate, scale) on this geometry. More...
 
void WorldToIndex (const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
 Convert world coordinates (mm) of a point to continuous index coordinates. More...
 
void WorldToIndex (const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const
 Convert world coordinates (mm) of a vector to continuous index coordinates. More...
 
template<unsigned int VIndexDimension>
void WorldToIndex (const mitk::Point3D &pt_mm, itk::Index< VIndexDimension > &index) const
 Convert world coordinates (mm) of a point to discrete (integer) index coordinates. More...
 
void IndexToWorld (const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
 Convert index coordinates of a vector to world coordinates (mm). More...
 
void IndexToWorld (const mitk::Point3D &pt_units, mitk::Point3D &pt_mm) const
 Convert continuous or discrete index coordinates of a point to world coordinates (mm). More...
 
template<unsigned int VIndexDimension>
void IndexToWorld (const itk::Index< VIndexDimension > &index, mitk::Point3D &pt_mm) const
 Convert discrete (itk::Index) index coordinates of a point to world coordinates (mm). More...
 
template<class TCoordRep >
void ItkPhysicalPointToWorld (const itk::Point< TCoordRep, 3 > &itkPhysicalPoint, mitk::Point3D &pt_mm) const
 Convert an ITK physical point to MITK world coordinates. More...
 
template<class TCoordRep >
void WorldToItkPhysicalPoint (const mitk::Point3D &pt_mm, itk::Point< TCoordRep, 3 > &itkPhysicalPoint) const
 Convert MITK world coordinates to ITK physical coordinates. More...
 
virtual const BoundingBoxType * GetBoundingBox ()
 Get the bounding box in index/unit coordinates. More...
 
const BoundsArrayType GetBounds () const
 Get the bounding box bounds as a BoundsArrayType in index/unit coordinates. More...
 
void SetBounds (const BoundsArrayType &bounds)
 Set the bounding box in index/unit coordinates. More...
 
void SetFloatBounds (const float bounds[6])
 Set the bounding box via a float array. More...
 
void SetFloatBounds (const double bounds[6])
 Set the bounding box via a double array. More...
 
VnlVector GetMatrixColumn (unsigned int direction) const
 Get a column of the IndexToWorldTransform matrix as a VnlVector. More...
 
mitk::BoundingBox::Pointer CalculateBoundingBoxRelativeToTransform (const mitk::AffineTransform3D *transform) const
 Calculate a bounding box relative to a given transform. More...
 
ScalarType GetExtent (unsigned int direction) const
 Set the time bounds (in ms) More...
 
ScalarType GetExtentInMM (int direction) const
 Get the extent of the bounding box in mm along the specified direction. More...
 
Vector3D GetAxisVector (unsigned int direction) const
 Get a vector along the bounding box in the specified direction in mm. More...
 
virtual bool Is2DConvertable ()
 Check if this geometry can be converted to 2D without information loss. More...
 
Point3D GetCenter () const
 Get the center of the bounding box in world coordinates (mm). More...
 
double GetDiagonalLength2 () const
 Get the squared length of the bounding-box diagonal in mm. More...
 
double GetDiagonalLength () const
 Get the length of the bounding-box diagonal in mm. More...
 
Point3D GetCornerPoint (int id) const
 Get the position of corner number id in world coordinates. More...
 
Point3D GetCornerPoint (bool xFront=true, bool yFront=true, bool zFront=true) const
 Get the position of a corner in world coordinates. More...
 
void SetExtentInMM (int direction, ScalarType extentInMM)
 Set the extent of the bounding box in mm along the specified direction. More...
 
bool IsInside (const mitk::Point3D &p) const
 Test whether a point (world coordinates, mm) lies inside the bounding box. More...
 
bool IsIndexInside (const mitk::Point3D &index) const
 Test whether a point in continuous index coordinates lies inside the bounding box. More...
 
template<unsigned int VIndexDimension>
bool IsIndexInside (const itk::Index< VIndexDimension > &index) const
 Test whether a discrete ITK index lies inside the bounding box. More...
 
Point3D ClampPoint (const Point3D &point) const
 Clamp a point to lie within the geometry's world-coordinate bounds. More...
 
virtual void ChangeImageGeometryConsideringOriginOffset (const bool isAnImageGeometry)
 Switch between image geometry and normal geometry with origin correction. More...
 
virtual bool GetImageGeometry () const
 Query whether this geometry refers to an image. More...
 
virtual void SetImageGeometry (bool _arg)
 Define that this BaseGeometry refers to an image. More...
 
virtual void ImageGeometryOn ()
 Toggle macro for ImageGeometry (ImageGeometryOn/ImageGeometryOff). More...
 
virtual void ImageGeometryOff ()
 
const GeometryTransformHolder * GetGeometryTransformHolder () const
 Get the internal GeometryTransformHolder. More...
 
void MapAxesToOrientations (int axes[]) const
 Map geometry axes to anatomical orientations (sagittal, coronal, axial). More...
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 Geometry3D ()
 
 Geometry3D (const Geometry3D &)
 
 ~Geometry3D () override
 
 mitkCloneMacro (Self)
 
void PreSetSpacing (const mitk::Vector3D &aSpacing) override
 PreSetSpacing. More...
 
- Protected Member Functions inherited from mitk::BaseGeometry
 BaseGeometry ()
 
 BaseGeometry (const BaseGeometry &other)
 
 ~BaseGeometry () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual unsigned int GetNDimensions () const
 
bool IsBoundingBoxNull () const
 
bool IsIndexToWorldTransformNull () const
 
void SetVtkMatrixDeepCopy (vtkTransform *vtktransform)
 
void _SetSpacing (const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
 
virtual void CheckBounds (const BoundsArrayType &)
 CheckBounds. More...
 
virtual void CheckIndexToWorldTransform (mitk::AffineTransform3D *)
 CheckIndexToWorldTransform. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from mitk::BaseGeometry
static const std::string GetTransformAsString (TransformType *transformType)
 

Detailed Description

Standard three-dimensional geometry.

Geometry3D is the default concrete implementation of BaseGeometry. It provides a standard 3D spatial reference (origin, spacing, and affine IndexToWorldTransform) without any additional constraints beyond those defined by BaseGeometry.

Most MITK data objects (Image, Surface, PointSet) use Geometry3D as their spatial geometry unless a more specialized geometry (PlaneGeometry, SlicedGeometry3D, etc.) is required.

See also
BaseGeometry, PlaneGeometry, SlicedGeometry3D

Definition at line 44 of file mitkGeometry3D.h.

Member Typedef Documentation

◆ QuaternionTransformType

typedef itk::QuaternionRigidTransform<ScalarType> mitk::Geometry3D::QuaternionTransformType

Quaternion rigid transform type (for rotation representations).

Definition at line 50 of file mitkGeometry3D.h.

◆ VnlQuaternionType

typedef QuaternionTransformType::VnlQuaternionType mitk::Geometry3D::VnlQuaternionType

VNL quaternion type derived from QuaternionTransformType.

Definition at line 52 of file mitkGeometry3D.h.

Constructor & Destructor Documentation

◆ Geometry3D() [1/2]

mitk::Geometry3D::Geometry3D ( )
protected

◆ Geometry3D() [2/2]

mitk::Geometry3D::Geometry3D ( const Geometry3D &  )
protected

◆ ~Geometry3D()

mitk::Geometry3D::~Geometry3D ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::Geometry3D::Clone ( ) const

◆ mitkClassMacro()

mitk::Geometry3D::mitkClassMacro ( Geometry3D  ,
mitk::BaseGeometry   
)

◆ mitkCloneMacro()

mitk::Geometry3D::mitkCloneMacro ( Self  )
protected

◆ mitkNewMacro1Param()

mitk::Geometry3D::mitkNewMacro1Param ( Self  ,
const Self &   
)

◆ New()

static Pointer mitk::Geometry3D::New ( )
static

Method for creation through the object factory.

◆ PreSetSpacing()

void mitk::Geometry3D::PreSetSpacing ( const mitk::Vector3D &  aSpacing)
inlineoverrideprotectedvirtual

PreSetSpacing.

These virtual function allows a different beahiour in subclasses. Do implement them in every subclass of BaseGeometry. If not needed, use Superclass::PreSetSpacing().

Reimplemented from mitk::BaseGeometry.

Definition at line 74 of file mitkGeometry3D.h.


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