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

Helper class that manages transform-related variables for geometries. More...

#include <mitkGeometryTransformHolder.h>

Public Types

typedef itk::ScalableAffineTransform< ScalarType, 3 > TransformType
 

Public Member Functions

 GeometryTransformHolder ()
 Default constructor. More...
 
 GeometryTransformHolder (const GeometryTransformHolder &other)
 Copy constructor. More...
 
virtual ~GeometryTransformHolder ()
 Destructor. More...
 
void Initialize ()
 Initialize the transform to default values. More...
 
void Initialize (const GeometryTransformHolder *other)
 Initialize this transform holder from another instance. More...
 
Point3D GetOrigin () const
 Get the origin, e.g. the upper-left corner of the plane. More...
 
void SetOrigin (const Point3D &origin)
 Set the origin, i.e. the upper-left corner of the plane. More...
 
mitk::Vector3D GetSpacing () const
 Get the spacing (size of a pixel). More...
 
void SetSpacing (const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
 Set the spacing. More...
 
mitk::AffineTransform3D * GetIndexToWorldTransform ()
 Get the transformation used to convert from index to world coordinates. More...
 
const mitk::AffineTransform3D * GetIndexToWorldTransform () const
 Get the transformation used to convert from index to world coordinates (const version). More...
 
void SetIndexToWorldTransform (mitk::AffineTransform3D *transform)
 Set the transformation used to convert from index to world coordinates. More...
 
virtual void SetIndexToWorldTransformByVtkMatrix (vtkMatrix4x4 *vtkmatrix)
 Set the ITK transform (m_IndexToWorldTransform) via a vtkMatrix4x4. More...
 
void SetIndexToWorldTransformWithoutChangingSpacing (mitk::AffineTransform3D *transform)
 Set the transformation used to convert from index to world coordinates, keeping original spacing. More...
 
void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing (vtkMatrix4x4 *vtkmatrix)
 Set the ITK transform via a vtkMatrix4x4, keeping original spacing. More...
 
vtkMatrix4x4 * GetVtkMatrix ()
 Get the VTK matrix which describes the transform. More...
 
const vtkMatrix4x4 * GetVtkMatrix () const
 Get the VTK matrix which describes the transform (const version). More...
 
vtkLinearTransform * GetVtkTransform () const
 Get the index-to-world transform as a vtkLinearTransform. More...
 
void SetMatrix (Matrix3D &matrix)
 Set the rotation/scaling matrix. More...
 
void SetIdentity ()
 Set the transform to identity. More...
 
void Compose (const TransformType *other, bool pre=false)
 Compose with another transform. More...
 
void SetVtkMatrixDeepCopy (vtkTransform *vtktransform)
 Deep-copy a vtkTransform into the internal VTK matrix. More...
 
bool IsIndexToWorldTransformNull ()
 Check whether the IndexToWorldTransform is null. More...
 
AffineTransform3D::MatrixType::InternalMatrixType GetVnlMatrix ()
 Get the VNL matrix representation of the transform. More...
 

Detailed Description

Helper class that manages transform-related variables for geometries.

GeometryTransformHolder keeps all information about the transform (e.g. spacing, offset, transformation matrices) in consistent states. It provides getters and setters to all transformation-related information. Implementation is hidden and may be subject to changes.

See also
BaseGeometry

Definition at line 37 of file mitkGeometryTransformHolder.h.

Member Typedef Documentation

◆ TransformType

typedef itk::ScalableAffineTransform<ScalarType, 3> mitk::GeometryTransformHolder::TransformType

Definition at line 69 of file mitkGeometryTransformHolder.h.

Constructor & Destructor Documentation

◆ GeometryTransformHolder() [1/2]

mitk::GeometryTransformHolder::GeometryTransformHolder ( )

Default constructor.

◆ GeometryTransformHolder() [2/2]

mitk::GeometryTransformHolder::GeometryTransformHolder ( const GeometryTransformHolder &  other)

Copy constructor.

Parameters
otherThe GeometryTransformHolder to copy from.

◆ ~GeometryTransformHolder()

virtual mitk::GeometryTransformHolder::~GeometryTransformHolder ( )
virtual

Destructor.

Member Function Documentation

◆ Compose()

void mitk::GeometryTransformHolder::Compose ( const TransformType *  other,
bool  pre = false 
)

Compose with another transform.

Parameters
otherThe transform to compose with.
preIf true, the other transform is applied before this one; if false, after.

◆ GetIndexToWorldTransform() [1/2]

mitk::AffineTransform3D* mitk::GeometryTransformHolder::GetIndexToWorldTransform ( )

Get the transformation used to convert from index to world coordinates.

Returns
Pointer to the AffineTransform3D.

◆ GetIndexToWorldTransform() [2/2]

const mitk::AffineTransform3D* mitk::GeometryTransformHolder::GetIndexToWorldTransform ( ) const

Get the transformation used to convert from index to world coordinates (const version).

Returns
Const pointer to the AffineTransform3D.

◆ GetOrigin()

Point3D mitk::GeometryTransformHolder::GetOrigin ( ) const

Get the origin, e.g. the upper-left corner of the plane.

Returns
The origin point in world coordinates.

◆ GetSpacing()

mitk::Vector3D mitk::GeometryTransformHolder::GetSpacing ( ) const

Get the spacing (size of a pixel).

Returns
The spacing as a 3D vector.

◆ GetVnlMatrix()

AffineTransform3D::MatrixType::InternalMatrixType mitk::GeometryTransformHolder::GetVnlMatrix ( )

Get the VNL matrix representation of the transform.

Returns
The VNL internal matrix type.

◆ GetVtkMatrix() [1/2]

vtkMatrix4x4* mitk::GeometryTransformHolder::GetVtkMatrix ( )

Get the VTK matrix which describes the transform.

Returns
Pointer to the vtkMatrix4x4.

◆ GetVtkMatrix() [2/2]

const vtkMatrix4x4* mitk::GeometryTransformHolder::GetVtkMatrix ( ) const

Get the VTK matrix which describes the transform (const version).

Returns
Const pointer to the vtkMatrix4x4.

◆ GetVtkTransform()

vtkLinearTransform* mitk::GeometryTransformHolder::GetVtkTransform ( ) const

Get the index-to-world transform as a vtkLinearTransform.

Returns
Pointer to the vtkLinearTransform.

◆ Initialize() [1/2]

void mitk::GeometryTransformHolder::Initialize ( )

Initialize the transform to default values.

◆ Initialize() [2/2]

void mitk::GeometryTransformHolder::Initialize ( const GeometryTransformHolder *  other)

Initialize this transform holder from another instance.

Parameters
otherThe GeometryTransformHolder to initialize from.

◆ IsIndexToWorldTransformNull()

bool mitk::GeometryTransformHolder::IsIndexToWorldTransformNull ( )

Check whether the IndexToWorldTransform is null.

Returns
true if the transform is null, false otherwise.

◆ SetIdentity()

void mitk::GeometryTransformHolder::SetIdentity ( )

Set the transform to identity.

◆ SetIndexToWorldTransform()

void mitk::GeometryTransformHolder::SetIndexToWorldTransform ( mitk::AffineTransform3D *  transform)

Set the transformation used to convert from index to world coordinates.

This will also change the spacing.

Parameters
transformThe AffineTransform3D to set.

◆ SetIndexToWorldTransformByVtkMatrix()

virtual void mitk::GeometryTransformHolder::SetIndexToWorldTransformByVtkMatrix ( vtkMatrix4x4 *  vtkmatrix)
virtual

Set the ITK transform (m_IndexToWorldTransform) via a vtkMatrix4x4.

Convenience method. This will also change the spacing.

Parameters
vtkmatrixThe vtkMatrix4x4 to set the transform from.
See also
SetIndexToWorldTransform

◆ SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing()

void mitk::GeometryTransformHolder::SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing ( vtkMatrix4x4 *  vtkmatrix)

Set the ITK transform via a vtkMatrix4x4, keeping original spacing.

Convenience method.

Parameters
vtkmatrixThe vtkMatrix4x4 to set the transform from.
See also
SetIndexToWorldTransform

◆ SetIndexToWorldTransformWithoutChangingSpacing()

void mitk::GeometryTransformHolder::SetIndexToWorldTransformWithoutChangingSpacing ( mitk::AffineTransform3D *  transform)

Set the transformation used to convert from index to world coordinates, keeping original spacing.

Parameters
transformThe AffineTransform3D to set.

◆ SetMatrix()

void mitk::GeometryTransformHolder::SetMatrix ( Matrix3D &  matrix)

Set the rotation/scaling matrix.

Parameters
matrixThe 3x3 matrix to set.

◆ SetOrigin()

void mitk::GeometryTransformHolder::SetOrigin ( const Point3D &  origin)

Set the origin, i.e. the upper-left corner of the plane.

Parameters
originThe origin point in world coordinates.

◆ SetSpacing()

void mitk::GeometryTransformHolder::SetSpacing ( const mitk::Vector3D &  aSpacing,
bool  enforceSetSpacing = false 
)

Set the spacing.

The spacing is also changed in the IndexToWorldTransform.

Parameters
aSpacingThe spacing to set as a 3D vector.
enforceSetSpacingIf true, spacing is set even when the transform suggests otherwise.

◆ SetVtkMatrixDeepCopy()

void mitk::GeometryTransformHolder::SetVtkMatrixDeepCopy ( vtkTransform *  vtktransform)

Deep-copy a vtkTransform into the internal VTK matrix.

Parameters
vtktransformThe vtkTransform to copy from.

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