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

Describes the geometry of a plane object. More...

#include <mitkPlaneGeometry.h>

Inheritance diagram for mitk::PlaneGeometry:
Collaboration diagram for mitk::PlaneGeometry:

Public Member Functions

 mitkClassMacro (PlaneGeometry, BaseGeometry)
 
Pointer Clone () const
 
virtual void IndexToWorld (const Point2D &pt_units, Point2D &pt_mm) const
 Convert 2D index coordinates (units) to 2D world coordinates (mm). More...
 
virtual void WorldToIndex (const Point2D &pt_mm, Point2D &pt_units) const
 Convert 2D world coordinates (mm) to 2D index coordinates (units). More...
 
virtual void IndexToWorld (const mitk::Vector2D &vec_units, mitk::Vector2D &vec_mm) const
 Convert 2D index coordinates of a vector to world coordinates (mm). More...
 
virtual void WorldToIndex (const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units) const
 Convert world coordinates (mm) of a 2D vector to continuous index coordinates. More...
 
virtual void InitializeStandardPlane (const BaseGeometry *geometry3D, AnatomicalPlane planeorientation=AnatomicalPlane::Axial, ScalarType zPosition=0, bool frontside=true, bool rotated=false, bool top=true)
 Initialize a plane with orientation AnatomicalPlane (default: axial) with respect to BaseGeometry (default: identity). Spacing also taken from BaseGeometry. More...
 
virtual void InitializeStandardPlane (const BaseGeometry *geometry3D, bool top, AnatomicalPlane planeorientation=AnatomicalPlane::Axial, bool frontside=true, bool rotated=false)
 Initialize a plane with orientation AnatomicalPlane (default: axial) with respect to BaseGeometry (default: identity). Spacing also taken from BaseGeometry. More...
 
virtual void InitializeStandardPlane (ScalarType width, ScalarType height, const AffineTransform3D *transform=nullptr, AnatomicalPlane planeorientation=AnatomicalPlane::Axial, ScalarType zPosition=0, bool frontside=true, bool rotated=false, bool top=true)
 Initialize a plane with orientation AnatomicalPlane (default: axial) with respect to transform (default: identity) given width and height in units. More...
 
virtual void InitializeStandardPlane (ScalarType width, ScalarType height, const Vector3D &spacing, AnatomicalPlane planeorientation=AnatomicalPlane::Axial, ScalarType zPosition=0, bool frontside=true, bool rotated=false, bool top=true)
 Initialize plane with orientation AnatomicalPlane (default: axial) given width, height and spacing. More...
 
virtual void InitializeStandardPlane (ScalarType width, ScalarType height, const Vector3D &rightVector, const Vector3D &downVector, const Vector3D *spacing=nullptr)
 Initialize plane by width and height in pixels, right-/down-vector (itk) to describe orientation in world-space (vectors will be normalized) and spacing (default: 1.0 mm in all directions). More...
 
virtual void InitializeStandardPlane (ScalarType width, ScalarType height, const VnlVector &rightVector, const VnlVector &downVector, const Vector3D *spacing=nullptr)
 Initialize plane by width and height in pixels, right-/down-vector (vnl) to describe orientation in world-space (vectors will be normalized) and spacing (default: 1.0 mm in all directions). More...
 
virtual void InitializeStandardPlane (const Vector3D &rightVector, const Vector3D &downVector, const Vector3D *spacing=nullptr)
 Initialize plane by right-/down-vector (itk) and spacing (default: 1.0 mm in all directions). More...
 
virtual void InitializeStandardPlane (const VnlVector &rightVector, const VnlVector &downVector, const Vector3D *spacing=nullptr)
 Initialize plane by right-/down-vector (vnl) and spacing (default: 1.0 mm in all directions). More...
 
virtual void InitializePlane (const Point3D &origin, const Vector3D &normal)
 Initialize plane by origin and normal (size is 1.0 mm in all directions, direction of right-/down-vector valid but undefined). More...
 
void SetMatrixByVectors (const VnlVector &rightVector, const VnlVector &downVector, ScalarType thickness=1.0)
 Initialize plane by right-/down-vector. More...
 
Vector3D GetNormal () const
 Get the normal vector of the plane. More...
 
VnlVector GetNormalVnl () const
 Get the normal vector of the plane as a VnlVector. More...
 
virtual ScalarType SignedDistance (const Point3D &pt3d_mm) const
 Compute the signed distance of a point from the plane. More...
 
virtual bool IsAbove (const Point3D &pt3d_mm, bool considerBoundingBox=false) const
 Determine whether a point is above (in the normal direction of) the plane. More...
 
ScalarType DistanceFromPlane (const Point3D &pt3d_mm) const
 Unsigned distance of a point from the infinite plane. More...
 
ScalarType SignedDistanceFromPlane (const Point3D &pt3d_mm) const
 Signed distance of the point from the plane (bounding-box not considered) More...
 
ScalarType DistanceFromPlane (const PlaneGeometry *plane) const
 Distance of the plane from another plane (bounding-box not considered) More...
 
ScalarType SignedDistanceFromPlane (const PlaneGeometry *plane) const
 Signed distance of the plane from another plane (bounding-box not considered) More...
 
bool IntersectionLine (const PlaneGeometry *plane, Line3D &crossline) const
 Calculate the intersecting line of two planes. More...
 
unsigned int IntersectWithPlane2D (const PlaneGeometry *plane, Point2D &lineFrom, Point2D &lineTo) const
 Calculate two points where another plane intersects the border of this plane. More...
 
double Angle (const PlaneGeometry *plane) const
 Calculate the angle between two planes. More...
 
double Angle (const Line3D &line) const
 Calculate the angle between the plane and a line. More...
 
bool IntersectionPoint (const Line3D &line, Point3D &intersectionPoint) const
 Calculate intersection point between the plane and a line. More...
 
bool IntersectionPointParam (const Line3D &line, double &t) const
 Calculate line parameter of intersection point between the plane and a line. More...
 
bool IsParallel (const PlaneGeometry *plane) const
 Returns whether the plane is parallel to another plane. More...
 
bool IsOnPlane (const Point3D &point) const
 Returns whether the point is on the plane (bounding-box not considered) More...
 
bool IsOnPlane (const Line3D &line) const
 Returns whether the line is on the plane (bounding-box not considered) More...
 
bool IsOnPlane (const PlaneGeometry *plane) const
 Returns whether the plane is on the plane (bounding-box not considered) More...
 
Point3D ProjectPointOntoPlane (const Point3D &pt) const
 Returns the lot from the point to the plane. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an operation to re-orient or reposition the plane. More...
 
virtual bool Map (const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const
 Project a 3D point given in mm (pt3d_mm) onto the 2D geometry. The result is a 2D point in mm (pt2d_mm). More...
 
virtual void Map (const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const
 Converts a 2D point given in mm (pt2d_mm) relative to the upper-left corner of the geometry into the corresponding world-coordinate (a 3D point in mm, pt3d_mm). More...
 
virtual void SetSizeInUnits (mitk::ScalarType width, mitk::ScalarType height)
 Set the width and height of this 2D-geometry in units by calling SetBounds. This does not change the extent in mm! More...
 
virtual bool Project (const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const
 Project a 3D point given in mm (pt3d_mm) onto the 2D geometry. The result is a 3D point in mm (projectedPt3d_mm). More...
 
virtual bool Map (const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec3d_mm, mitk::Vector2D &vec2d_mm) const
 Project a 3D vector given in mm (vec3d_mm) onto the 2D geometry. The result is a 2D vector in mm (vec2d_mm). More...
 
virtual void Map (const mitk::Point2D &atPt2d_mm, const mitk::Vector2D &vec2d_mm, mitk::Vector3D &vec3d_mm) const
 Converts a 2D vector given in mm (vec2d_mm) relative to the upper-left corner of the geometry into the corresponding world-coordinate (a 3D vector in mm, vec3d_mm). More...
 
virtual bool Project (const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const
 Project a 3D vector given in mm (vec3d_mm) onto the 2D geometry. The result is a 3D vector in mm (projectedVec3d_mm). More...
 
ScalarType Distance (const Point3D &pt3d_mm) const
 Unsigned distance of a point from the geometry. More...
 
void SetReferenceGeometry (const mitk::BaseGeometry *geometry)
 Set the geometrical frame of reference in which this PlaneGeometry is placed. More...
 
const BaseGeometry * GetReferenceGeometry () const
 Get the geometrical frame of reference for this PlaneGeometry. More...
 
bool HasReferenceGeometry () const
 Check whether a reference geometry has been set. More...
 
- 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 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 ()
 
static bool CheckRotationMatrix (AffineTransform3D *transform, double epsilon=1e-6)
 Check if matrix is a rotation matrix: More...
 

Protected Member Functions

 PlaneGeometry ()
 
 PlaneGeometry (const PlaneGeometry &other)
 
 ~PlaneGeometry () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void PreSetSpacing (const mitk::Vector3D &aSpacing) override
 PreSetSpacing. More...
 
void CheckBounds (const BoundsArrayType &bounds) override
 CheckBounds. More...
 
void CheckIndexToWorldTransform (mitk::AffineTransform3D *transform) override
 CheckIndexToWorldTransform. More...
 
 mitkCloneMacro (Self)
 
- 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)
 

Protected Attributes

const mitk::BaseGeometry * m_ReferenceGeometry
 

Additional Inherited Members

- 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...
 
- Static Protected Member Functions inherited from mitk::BaseGeometry
static const std::string GetTransformAsString (TransformType *transformType)
 

Detailed Description

Describes the geometry of a plane object.

Describes a two-dimensional manifold, i.e., to put it simply, an object that can be described using a 2D coordinate-system.

PlaneGeometry can map points between 3D world coordinates (in mm) and the described 2D coordinate-system (in mm) by first projecting the 3D point onto the 2D manifold and then calculating the 2D-coordinates (in mm). These 2D-mm-coordinates can be further converted into 2D-unit-coordinates (e.g., pixels), giving a parameter representation of the object with parameter values inside a rectangle (e.g., [0,0]..[width, height]), which is the bounding box (bounding range in z-direction always [0]..[1]).

A PlaneGeometry describes the 2D representation within a 3D object (derived from BaseGeometry). For example, a single CT-image (slice) is 2D in the sense that you can access the pixels using 2D-coordinates, but is also 3D, as the pixels are really voxels, thus have an extension (thickness) in the 3rd dimension.

Optionally, a reference BaseGeometry can be specified, which usually would be the geometry associated with the underlying dataset. This is currently used for calculating the intersection of inclined / rotated planes (represented as PlaneGeometry) with the bounding box of the associated BaseGeometry.

Warning
The PlaneGeometry are not necessarily up-to-date and not even initialized. As described in the previous paragraph, one of the Generate-/Copy-/UpdateOutputInformation methods have to initialize it. mitk::BaseData::GetPlaneGeometry() makes sure, that the PlaneGeometry is up-to-date before returning it (by setting the update extent appropriately and calling UpdateOutputInformation).

Rule: everything is in mm (or ms for temporal information) if not stated otherwise.

Describes a two-dimensional, rectangular plane

Definition at line 74 of file mitkPlaneGeometry.h.

Constructor & Destructor Documentation

◆ PlaneGeometry() [1/2]

mitk::PlaneGeometry::PlaneGeometry ( )
protected

◆ PlaneGeometry() [2/2]

mitk::PlaneGeometry::PlaneGeometry ( const PlaneGeometry &  other)
protected

◆ ~PlaneGeometry()

mitk::PlaneGeometry::~PlaneGeometry ( )
overrideprotected

Member Function Documentation

◆ Angle() [1/2]

double mitk::PlaneGeometry::Angle ( const Line3D &  line) const

Calculate the angle between the plane and a line.

Returns
angle in radiants

◆ Angle() [2/2]

double mitk::PlaneGeometry::Angle ( const PlaneGeometry *  plane) const

Calculate the angle between two planes.

Returns
angle in radiants

◆ CheckBounds()

void mitk::PlaneGeometry::CheckBounds ( const BoundsArrayType &  bounds)
overrideprotectedvirtual

CheckBounds.

This function is called in SetBounds. Assertions can be implemented in this function (see PlaneGeometry.cpp). If you implement this function in a subclass, make sure, that all classes were your class inherits from have an implementation of CheckBounds (e.g. inheritance BaseGeometry <- A <- B. Implementation of CheckBounds in class B needs implementation in A as

Reimplemented from mitk::BaseGeometry.

◆ CheckIndexToWorldTransform()

void mitk::PlaneGeometry::CheckIndexToWorldTransform ( mitk::AffineTransform3D *  transform)
overrideprotectedvirtual

CheckIndexToWorldTransform.

This function is called in SetIndexToWorldTransform. Assertions can be implemented in this function (see

Reimplemented from mitk::BaseGeometry.

◆ CheckRotationMatrix()

static bool mitk::PlaneGeometry::CheckRotationMatrix ( AffineTransform3D *  transform,
double  epsilon = 1e-6 
)
static

Check if matrix is a rotation matrix:

  • determinant is 1?
  • R*R^T is ID? Output warning otherwise.

◆ Clone()

Pointer mitk::PlaneGeometry::Clone ( ) const

◆ Distance()

ScalarType mitk::PlaneGeometry::Distance ( const Point3D &  pt3d_mm) const
inline

Unsigned distance of a point from the geometry.

Returns the absolute value of SignedDistance(). The bounding box is not considered for the underlying plane distance calculation.

Parameters
[in]pt3d_mmPoint in world coordinates (mm).
Returns
Unsigned distance in mm.
See also
SignedDistance

Definition at line 559 of file mitkPlaneGeometry.h.

◆ DistanceFromPlane() [1/2]

ScalarType mitk::PlaneGeometry::DistanceFromPlane ( const PlaneGeometry *  plane) const
inline

Distance of the plane from another plane (bounding-box not considered)

Result is 0 if planes are not parallel.

Definition at line 361 of file mitkPlaneGeometry.h.

◆ DistanceFromPlane() [2/2]

ScalarType mitk::PlaneGeometry::DistanceFromPlane ( const Point3D &  pt3d_mm) const

Unsigned distance of a point from the infinite plane.

The bounding box is not considered.

Parameters
[in]pt3d_mmPoint in world coordinates (mm).
Returns
Distance in mm (always >= 0).

◆ ExecuteOperation()

void mitk::PlaneGeometry::ExecuteOperation ( Operation *  operation)
overridevirtual

Execute an operation to re-orient or reposition the plane.

Handles operations such as OpORIENT (re-orientation via PlaneOperation) in addition to the standard operations inherited from BaseGeometry.

Parameters
[in]operationThe operation to execute.

Reimplemented from mitk::BaseGeometry.

◆ GetNormal()

Vector3D mitk::PlaneGeometry::GetNormal ( ) const

Get the normal vector of the plane.

The normal is the third column of the IndexToWorldTransform matrix, representing the direction perpendicular to the plane surface.

Returns
Normal vector in world coordinates.

◆ GetNormalVnl()

VnlVector mitk::PlaneGeometry::GetNormalVnl ( ) const

Get the normal vector of the plane as a VnlVector.

Returns
Normal as a VnlVector.
See also
GetNormal

◆ GetReferenceGeometry()

const BaseGeometry* mitk::PlaneGeometry::GetReferenceGeometry ( ) const

Get the geometrical frame of reference for this PlaneGeometry.

Returns
Const pointer to the reference geometry, or nullptr if not set.

◆ HasReferenceGeometry()

bool mitk::PlaneGeometry::HasReferenceGeometry ( ) const

Check whether a reference geometry has been set.

Returns
true if a non-null reference geometry is available.

◆ IndexToWorld() [1/2]

virtual void mitk::PlaneGeometry::IndexToWorld ( const mitk::Vector2D &  vec_units,
mitk::Vector2D &  vec_mm 
) const
virtual

Convert 2D index coordinates of a vector to world coordinates (mm).

Parameters
[in]vec_unitsVector in index coordinates.
[out]vec_mmVector in world coordinates (mm).

Reimplemented in mitk::AbstractTransformGeometry.

◆ IndexToWorld() [2/2]

virtual void mitk::PlaneGeometry::IndexToWorld ( const Point2D &  pt_units,
Point2D &  pt_mm 
) const
virtual

Convert 2D index coordinates (units) to 2D world coordinates (mm).

Uses the in-plane extent ratio (ExtentInMM / Extent) per axis.

Parameters
[in]pt_units2D point in index/unit coordinates.
[out]pt_mm2D point in world coordinates (mm).

Reimplemented in mitk::AbstractTransformGeometry.

◆ InitializePlane()

virtual void mitk::PlaneGeometry::InitializePlane ( const Point3D &  origin,
const Vector3D &  normal 
)
virtual

Initialize plane by origin and normal (size is 1.0 mm in all directions, direction of right-/down-vector valid but undefined).

Warning
This function can only produce righthanded coordinate orientation, not lefthanded.

◆ InitializeStandardPlane() [1/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( const BaseGeometry *  geometry3D,
AnatomicalPlane  planeorientation = AnatomicalPlane::Axial,
ScalarType  zPosition = 0,
bool  frontside = true,
bool  rotated = false,
bool  top = true 
)
virtual

Initialize a plane with orientation AnatomicalPlane (default: axial) with respect to BaseGeometry (default: identity). Spacing also taken from BaseGeometry.

Warning
A former version of this method created a geometry with unit spacing. For unit spacing use
// for in-plane unit spacing:
thisgeometry->SetSizeInUnits(thisgeometry->GetExtentInMM(0),
thisgeometry->GetExtentInMM(1));
// additionally, for unit spacing in normal direction (former version
// did not do this):
thisgeometry->SetExtentInMM(2, 1.0);

◆ InitializeStandardPlane() [2/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( const BaseGeometry *  geometry3D,
bool  top,
AnatomicalPlane  planeorientation = AnatomicalPlane::Axial,
bool  frontside = true,
bool  rotated = false 
)
virtual

Initialize a plane with orientation AnatomicalPlane (default: axial) with respect to BaseGeometry (default: identity). Spacing also taken from BaseGeometry.

Parameters
geometry3D
topif true, create plane at top, otherwise at bottom (for AnatomicalPlane Axial, for other plane locations respectively)
planeorientation
frontside
rotated

◆ InitializeStandardPlane() [3/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( const Vector3D &  rightVector,
const Vector3D &  downVector,
const Vector3D *  spacing = nullptr 
)
virtual

Initialize plane by right-/down-vector (itk) and spacing (default: 1.0 mm in all directions).

The length of the right-/-down-vector is used as width/height in units, respectively. Then, the vectors are normalized and multiplied by the respective spacing before they are set in the matrix.

◆ InitializeStandardPlane() [4/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( const VnlVector &  rightVector,
const VnlVector &  downVector,
const Vector3D *  spacing = nullptr 
)
virtual

Initialize plane by right-/down-vector (vnl) and spacing (default: 1.0 mm in all directions).

The length of the right-/-down-vector is used as width/height in units, respectively. Then, the vectors are normalized and multiplied by the respective spacing before they are set in the matrix.

◆ InitializeStandardPlane() [5/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( ScalarType  width,
ScalarType  height,
const AffineTransform3D *  transform = nullptr,
AnatomicalPlane  planeorientation = AnatomicalPlane::Axial,
ScalarType  zPosition = 0,
bool  frontside = true,
bool  rotated = false,
bool  top = true 
)
virtual

Initialize a plane with orientation AnatomicalPlane (default: axial) with respect to transform (default: identity) given width and height in units.

Rotated means rotated by 180 degrees (1/2 rotation) within the plane. Rotation by 90 degrees (1/4 rotation) is not implemented as of now.

Frontside/Backside: Viewed from below = frontside in the axial case; (radiologist's view versus neuro-surgeon's view, see: http://www.itk.org/Wiki/images/e/ed/DICOM-OrientationDiagram-Radiologist-vs-NeuroSurgeon.png ) Viewed from front = frontside in the coronal case; Viewed from left = frontside in the sagittal case.

Cave/Caution: Currently only RPI, LAI, LPS and RAS in the three standard planes are covered, i.e. 12 cases of 144: 3 standard planes * 48 coordinate orientations = 144 cases.

◆ InitializeStandardPlane() [6/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( ScalarType  width,
ScalarType  height,
const Vector3D &  rightVector,
const Vector3D &  downVector,
const Vector3D *  spacing = nullptr 
)
virtual

Initialize plane by width and height in pixels, right-/down-vector (itk) to describe orientation in world-space (vectors will be normalized) and spacing (default: 1.0 mm in all directions).

The vectors are normalized and multiplied by the respective spacing before they are set in the matrix.

This overloaded version of InitializeStandardPlane() creates only righthanded coordinate orientations, unless spacing contains 1 or 3 negative entries.

◆ InitializeStandardPlane() [7/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( ScalarType  width,
ScalarType  height,
const Vector3D &  spacing,
AnatomicalPlane  planeorientation = AnatomicalPlane::Axial,
ScalarType  zPosition = 0,
bool  frontside = true,
bool  rotated = false,
bool  top = true 
)
virtual

Initialize plane with orientation AnatomicalPlane (default: axial) given width, height and spacing.

◆ InitializeStandardPlane() [8/8]

virtual void mitk::PlaneGeometry::InitializeStandardPlane ( ScalarType  width,
ScalarType  height,
const VnlVector &  rightVector,
const VnlVector &  downVector,
const Vector3D *  spacing = nullptr 
)
virtual

Initialize plane by width and height in pixels, right-/down-vector (vnl) to describe orientation in world-space (vectors will be normalized) and spacing (default: 1.0 mm in all directions).

The vectors are normalized and multiplied by the respective spacing before they are set in the matrix.

This overloaded version of InitializeStandardPlane() creates only righthanded coordinate orientations, unless spacing contains 1 or 3 negative entries.

◆ IntersectionLine()

bool mitk::PlaneGeometry::IntersectionLine ( const PlaneGeometry *  plane,
Line3D &  crossline 
) const

Calculate the intersecting line of two planes.

Returns
true planes are intersecting
false planes do not intersect

◆ IntersectionPoint()

bool mitk::PlaneGeometry::IntersectionPoint ( const Line3D &  line,
Point3D &  intersectionPoint 
) const

Calculate intersection point between the plane and a line.

Parameters
line
intersectionPointintersection point
Returns
true if unique intersection exists, i.e., if line is not on or parallel to the plane

◆ IntersectionPointParam()

bool mitk::PlaneGeometry::IntersectionPointParam ( const Line3D &  line,
double &  t 
) const

Calculate line parameter of intersection point between the plane and a line.

Parameters
line
tparameter of line: intersection point is line.GetPoint()+t*line.GetDirection()
Returns
true if unique intersection exists, i.e., if line is not on or parallel to the plane

◆ IntersectWithPlane2D()

unsigned int mitk::PlaneGeometry::IntersectWithPlane2D ( const PlaneGeometry *  plane,
Point2D &  lineFrom,
Point2D &  lineTo 
) const

Calculate two points where another plane intersects the border of this plane.

Returns
number of intersection points (0..2). First intersection point (if existing) is returned in lineFrom, second in lineTo.

◆ IsAbove()

virtual bool mitk::PlaneGeometry::IsAbove ( const Point3D &  pt3d_mm,
bool  considerBoundingBox = false 
) const
virtual

Determine whether a point is above (in the normal direction of) the plane.

Parameters
[in]pt3d_mmPoint in world coordinates (mm).
[in]considerBoundingBoxIf true, points outside the bounding box are always considered "not above".
Returns
true if the point is above the plane.

Reimplemented in mitk::AbstractTransformGeometry.

◆ IsOnPlane() [1/3]

bool mitk::PlaneGeometry::IsOnPlane ( const Line3D &  line) const

Returns whether the line is on the plane (bounding-box not considered)

◆ IsOnPlane() [2/3]

bool mitk::PlaneGeometry::IsOnPlane ( const PlaneGeometry *  plane) const

Returns whether the plane is on the plane (bounding-box not considered)

Returns
true if the normal vector of the planes point to the same or the exactly oposit direction and the distance of the planes is < eps

◆ IsOnPlane() [3/3]

bool mitk::PlaneGeometry::IsOnPlane ( const Point3D &  point) const

Returns whether the point is on the plane (bounding-box not considered)

◆ IsParallel()

bool mitk::PlaneGeometry::IsParallel ( const PlaneGeometry *  plane) const

Returns whether the plane is parallel to another plane.

Returns
true iff the normal vectors both point to the same or exactly oposit direction

◆ Map() [1/4]

virtual void mitk::PlaneGeometry::Map ( const mitk::Point2D &  atPt2d_mm,
const mitk::Vector2D &  vec2d_mm,
mitk::Vector3D &  vec3d_mm 
) const
virtual

Converts a 2D vector given in mm (vec2d_mm) relative to the upper-left corner of the geometry into the corresponding world-coordinate (a 3D vector in mm, vec3d_mm).

To convert a 2D vector given in units (e.g., pixels in case of an image) into a 2D vector given in mm (as required by this method), use IndexToWorld.

Reimplemented in mitk::AbstractTransformGeometry.

◆ Map() [2/4]

virtual void mitk::PlaneGeometry::Map ( const mitk::Point2D &  pt2d_mm,
mitk::Point3D &  pt3d_mm 
) const
virtual

Converts a 2D point given in mm (pt2d_mm) relative to the upper-left corner of the geometry into the corresponding world-coordinate (a 3D point in mm, pt3d_mm).

To convert a 2D point given in units (e.g., pixels in case of an image) into a 2D point given in mm (as required by this method), use IndexToWorld.

Reimplemented in mitk::AbstractTransformGeometry.

◆ Map() [3/4]

virtual bool mitk::PlaneGeometry::Map ( const mitk::Point3D &  atPt3d_mm,
const mitk::Vector3D &  vec3d_mm,
mitk::Vector2D &  vec2d_mm 
) const
virtual

Project a 3D vector given in mm (vec3d_mm) onto the 2D geometry. The result is a 2D vector in mm (vec2d_mm).

The result is a 2D vector in mm (vec2d_mm) relative to the upper-left corner of the geometry. To convert this point into units (e.g., pixels in case of an image), use WorldToIndex.

Returns
true projection was possible
See also
Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm)

Reimplemented in mitk::AbstractTransformGeometry.

◆ Map() [4/4]

virtual bool mitk::PlaneGeometry::Map ( const mitk::Point3D &  pt3d_mm,
mitk::Point2D &  pt2d_mm 
) const
virtual

Project a 3D point given in mm (pt3d_mm) onto the 2D geometry. The result is a 2D point in mm (pt2d_mm).

The result is a 2D point in mm (pt2d_mm) relative to the upper-left corner of the geometry. To convert this point into units (e.g., pixels in case of an image), use WorldToIndex.

Returns
true projection was possible
See also
Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm)

Reimplemented in mitk::AbstractTransformGeometry.

◆ mitkClassMacro()

mitk::PlaneGeometry::mitkClassMacro ( PlaneGeometry  ,
BaseGeometry   
)

◆ mitkCloneMacro()

mitk::PlaneGeometry::mitkCloneMacro ( Self  )
protected

◆ New()

static Pointer mitk::PlaneGeometry::New ( )
static

Method for creation through the object factory.

◆ PreSetSpacing()

void mitk::PlaneGeometry::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.

Reimplemented in mitk::ThinPlateSplineCurvedGeometry.

Definition at line 602 of file mitkPlaneGeometry.h.

◆ PrintSelf()

void mitk::PlaneGeometry::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

◆ Project() [1/2]

virtual bool mitk::PlaneGeometry::Project ( const mitk::Point3D &  pt3d_mm,
mitk::Point3D &  projectedPt3d_mm 
) const
virtual

Project a 3D point given in mm (pt3d_mm) onto the 2D geometry. The result is a 3D point in mm (projectedPt3d_mm).

Returns
true projection was possible

Reimplemented in mitk::AbstractTransformGeometry.

◆ Project() [2/2]

virtual bool mitk::PlaneGeometry::Project ( const mitk::Vector3D &  vec3d_mm,
mitk::Vector3D &  projectedVec3d_mm 
) const
virtual

Project a 3D vector given in mm (vec3d_mm) onto the 2D geometry. The result is a 3D vector in mm (projectedVec3d_mm).

Returns
true projection was possible

Reimplemented in mitk::AbstractTransformGeometry.

◆ ProjectPointOntoPlane()

Point3D mitk::PlaneGeometry::ProjectPointOntoPlane ( const Point3D &  pt) const

Returns the lot from the point to the plane.

◆ SetMatrixByVectors()

void mitk::PlaneGeometry::SetMatrixByVectors ( const VnlVector &  rightVector,
const VnlVector &  downVector,
ScalarType  thickness = 1.0 
)

Initialize plane by right-/down-vector.

Warning
The vectors are set into the matrix as they are, without normalization! This function creates a righthanded IndexToWorldTransform, only a negative thickness could still make it lefthanded.

◆ SetReferenceGeometry()

void mitk::PlaneGeometry::SetReferenceGeometry ( const mitk::BaseGeometry *  geometry)

Set the geometrical frame of reference in which this PlaneGeometry is placed.

This is typically the BaseGeometry of the underlying dataset (e.g., an Image). It is used for bounding-box intersection calculations of inclined / rotated planes. Setting it is optional.

Parameters
[in]geometryThe reference geometry (may be nullptr to clear).

◆ SetSizeInUnits()

virtual void mitk::PlaneGeometry::SetSizeInUnits ( mitk::ScalarType  width,
mitk::ScalarType  height 
)
virtual

Set the width and height of this 2D-geometry in units by calling SetBounds. This does not change the extent in mm!

For an image, this is the number of pixels in x-/y-direction.

Note
In contrast to calling SetBounds directly, this does not change the extent in mm!

◆ SignedDistance()

virtual ScalarType mitk::PlaneGeometry::SignedDistance ( const Point3D &  pt3d_mm) const
virtual

Compute the signed distance of a point from the plane.

The sign indicates which side of the plane the point lies on. If the point is within the bounding box but on the plane, the result is 0. If the point is outside the bounding box, the distance to the nearest in-bounds point on the plane is returned.

Parameters
[in]pt3d_mmPoint in world coordinates (mm).
Returns
Signed distance in mm.

◆ SignedDistanceFromPlane() [1/2]

ScalarType mitk::PlaneGeometry::SignedDistanceFromPlane ( const PlaneGeometry *  plane) const
inline

Signed distance of the plane from another plane (bounding-box not considered)

Result is 0 if planes are not parallel.

Definition at line 368 of file mitkPlaneGeometry.h.

References mitk::BaseGeometry::GetOrigin().

◆ SignedDistanceFromPlane() [2/2]

ScalarType mitk::PlaneGeometry::SignedDistanceFromPlane ( const Point3D &  pt3d_mm) const
inline

Signed distance of the point from the plane (bounding-box not considered)

0 : point is in the direction of the direction vector.

Definition at line 345 of file mitkPlaneGeometry.h.

References GetOrigin().

◆ WorldToIndex() [1/2]

virtual void mitk::PlaneGeometry::WorldToIndex ( const mitk::Vector2D &  vec_mm,
mitk::Vector2D &  vec_units 
) const
virtual

Convert world coordinates (mm) of a 2D vector to continuous index coordinates.

Parameters
[in]vec_mmVector in world coordinates (mm).
[out]vec_unitsVector in continuous index coordinates.

Reimplemented in mitk::AbstractTransformGeometry.

◆ WorldToIndex() [2/2]

virtual void mitk::PlaneGeometry::WorldToIndex ( const Point2D &  pt_mm,
Point2D &  pt_units 
) const
virtual

Convert 2D world coordinates (mm) to 2D index coordinates (units).

Inverse of IndexToWorld(Point2D, Point2D).

Parameters
[in]pt_mm2D point in world coordinates (mm).
[out]pt_units2D point in index/unit coordinates.

Reimplemented in mitk::AbstractTransformGeometry.

Member Data Documentation

◆ m_ReferenceGeometry

const mitk::BaseGeometry* mitk::PlaneGeometry::m_ReferenceGeometry
protected

Definition at line 594 of file mitkPlaneGeometry.h.


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