Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::BaseGeometry Class Referenceabstract

BaseGeometry Describes the geometry of a data object. More...

#include <mitkBaseGeometry.h>

Inheritance diagram for mitk::BaseGeometry:
Collaboration diagram for mitk::BaseGeometry:

Public Types

typedef BaseGeometry Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef GeometryTransformHolder::TransformType TransformType
 
typedef itk::BoundingBox< unsigned long, 3, ScalarTypeBoundingBoxType
 
typedef BoundingBoxType::BoundsArrayType BoundsArrayType
 
typedef BoundingBoxType::Pointer BoundingBoxPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
const 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...
 
const mitk::Vector3D GetSpacing () const
 Get the spacing (size of a pixel). More...
 
void SetSpacing (const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
 Set the spacing (m_Spacing). More...
 
VnlVector GetOriginVnl () const
 Get the origin as VnlVector. More...
 
virtual unsigned int GetFrameOfReferenceID () const
 Get the DICOM FrameOfReferenceID referring to the used world coordinate system. More...
 
virtual void SetFrameOfReferenceID (unsigned int _arg)
 Set the DICOM FrameOfReferenceID referring to the used world coordinate system. More...
 
virtual unsigned long GetIndexToWorldTransformLastModified () const
 
void Modified () const override
 Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class. More...
 
virtual bool IsValid () const
 Is this BaseGeometry in a state that is valid? More...
 
void Initialize ()
 Initialize the BaseGeometry. More...
 
void InitializeGeometry (Self *newGeometry) const
 
mitk::AffineTransform3DGetIndexToWorldTransform ()
 Get the transformation used to convert from index to world coordinates. More...
 
const mitk::AffineTransform3DGetIndexToWorldTransform () const
 Get the transformation used to convert from index to world coordinates. More...
 
void SetIndexToWorldTransform (mitk::AffineTransform3D *transform)
 
void SetIndexToWorldTransformByVtkMatrix (vtkMatrix4x4 *vtkmatrix)
 Convenience method for setting the ITK transform (m_IndexToWorldTransform) via an vtkMatrix4x4.The spacing of the new transform is copied to m_spacing. More...
 
void SetIndexToWorldTransformWithoutChangingSpacing (mitk::AffineTransform3D *transform)
 
void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing (vtkMatrix4x4 *vtkmatrix)
 Convenience method for setting the ITK transform (m_IndexToWorldTransform) via an vtkMatrix4x4. This function keeps the original spacing. More...
 
vtkMatrix4x4 * GetVtkMatrix ()
 
vtkLinearTransform * GetVtkTransform () const
 Get the m_IndexToWorldTransform as a vtkLinearTransform. More...
 
void SetIdentity ()
 Set the transform to identity, the spacing to 1 and origin to 0. More...
 
void Compose (const TransformType *other, bool pre=0)
 Compose new IndexToWorldTransform with a given transform. More...
 
void Compose (const vtkMatrix4x4 *vtkmatrix, bool pre=0)
 Compose new IndexToWorldTransform with a given vtkMatrix4x4. More...
 
void Translate (const Vector3D &vector)
 Translate the origin by a vector. More...
 
virtual void ExecuteOperation (Operation *operation) override
 executes affine operations (translate, rotate, scale) More...
 
void WorldToIndex (const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
 Convert world coordinates (in mm) of a point to (continuous!) index coordinates. More...
 
void WorldToIndex (const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const
 Convert world coordinates (in mm) of a vector vec_mm to (continuous!) index coordinates. For further information about coordinates types, please see the Geometry documentation. More...
 
template<unsigned int VIndexDimension>
void WorldToIndex (const mitk::Point3D &pt_mm, itk::Index< VIndexDimension > &index) const
 Convert world coordinates (in mm) of a point to (discrete!) index coordinates. This method rounds to integer indices! For further information about coordinates types, please see the Geometry documentation. More...
 
void IndexToWorld (const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
 Convert (continuous or discrete) index coordinates of a vector vec_units to world coordinates (in mm) For further information about coordinates types, please see the Geometry documentation. 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 (in mm) For further information about coordinates types, please see the Geometry documentation. More...
 
template<unsigned int VIndexDimension>
void IndexToWorld (const itk::Index< VIndexDimension > &index, mitk::Point3D &pt_mm) const
 Convert (discrete) index coordinates of a point to world coordinates (in mm) For further information about coordinates types, please see the Geometry documentation. More...
 
void IndexToWorld (const mitk::Point3D &atPt3d_units, const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
 Convert (continuous or discrete) index coordinates of a vector vec_units to world coordinates (in mm) More...
 
void WorldToIndex (const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const
 Convert world coordinates (in mm) of a vector vec_mm to (continuous!) index coordinates. More...
 
template<class TCoordRep >
void ItkPhysicalPointToWorld (const itk::Point< TCoordRep, 3 > &itkPhysicalPoint, mitk::Point3D &pt_mm) const
 Deprecated for use with ITK version 3.10 or newer. Convert ITK physical coordinates of a point (in mm, but without a rotation) into MITK world coordinates (in mm) More...
 
template<class TCoordRep >
void WorldToItkPhysicalPoint (const mitk::Point3D &pt_mm, itk::Point< TCoordRep, 3 > &itkPhysicalPoint) const
 Deprecated for use with ITK version 3.10 or newer. Convert world coordinates (in mm) of a point to ITK physical coordinates (in mm, but without a possible rotation) More...
 
virtual const BoundingBoxTypeGetBoundingBox ()
 
const BoundsArrayType GetBounds () const
 
void SetBounds (const BoundsArrayType &bounds)
 Set the bounding box (in index/unit coordinates) More...
 
void SetFloatBounds (const float bounds[6])
 Set the bounding box (in index/unit coordinates) via a float array. More...
 
void SetFloatBounds (const double bounds[6])
 Set the bounding box (in index/unit coordinates) via a double array. More...
 
VnlVector GetMatrixColumn (unsigned int direction) const
 Get a VnlVector along bounding-box in the specified direction, length is spacing. More...
 
mitk::BoundingBox::Pointer CalculateBoundingBoxRelativeToTransform (const mitk::AffineTransform3D *transform) const
 Calculates a bounding-box around the geometry relative to a coordinate system defined by a 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 the specified direction in mm. More...
 
Vector3D GetAxisVector (unsigned int direction) const
 Get vector along bounding-box in the specified direction in mm. More...
 
virtual bool Is2DConvertable ()
 Checks, if the given geometry can be converted to 2D without information loss e.g. when a 2D image is saved, the matrix is usually cropped to 2x2, and when you load it back to MITK it will be filled with standard values. This function checks, if information would be lost during this procedure. More...
 
Point3D GetCenter () const
 Get the center of the bounding-box in mm. More...
 
double GetDiagonalLength2 () const
 Get the squared length of the diagonal of the bounding-box in mm. More...
 
double GetDiagonalLength () const
 Get the length of the diagonal of the bounding-box in mm. More...
 
Point3D GetCornerPoint (int id) const
 Get the position of the 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 the specified direction in mm. More...
 
bool IsInside (const mitk::Point3D &p) const
 Test whether the point p (world coordinates in mm) is inside the bounding box. More...
 
bool IsIndexInside (const mitk::Point3D &index) const
 Test whether the point p ((continous!)index coordinates in units) is inside the bounding box. More...
 
template<unsigned int VIndexDimension>
bool IsIndexInside (const itk::Index< VIndexDimension > &index) const
 Convenience method for working with ITK indices. More...
 
virtual void ChangeImageGeometryConsideringOriginOffset (const bool isAnImageGeometry)
 When switching from an Image Geometry to a normal Geometry (and the other way around), you have to. More...
 
virtual bool GetImageGeometry () const
 Is this an ImageGeometry? More...
 
virtual void SetImageGeometry (bool _arg)
 Define that this BaseGeometry is refering to an Image. More...
 
virtual void ImageGeometryOn ()
 
virtual void ImageGeometryOff ()
 
const GeometryTransformHolderGetGeometryTransformHolder () const
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 BaseGeometry ()
 
 BaseGeometry (const BaseGeometry &other)
 
virtual ~BaseGeometry ()
 
virtual itk::LightObject::Pointer InternalClone () const override=0
 clones the geometry More...
 
virtual 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 PreSetSpacing (const mitk::Vector3D &)
 PreSetSpacing. More...
 
virtual void CheckBounds (const BoundsArrayType &)
 CheckBounds. More...
 
virtual void CheckIndexToWorldTransform (mitk::AffineTransform3D *)
 CheckIndexToWorldTransform. More...
 

Static Protected Member Functions

static const std::string GetTransformAsString (TransformType *transformType)
 

Detailed Description

BaseGeometry Describes the geometry of a data object.

The class holds

  • a bounding box which is axes-parallel in intrinsic coordinates (often integer indices of pixels), to be accessed by GetBoundingBox()
  • a transform to convert intrinsic coordinates into a world-coordinate system with coordinates in millimeters and milliseconds (all are floating point values), to be accessed by GetIndexToWorldTransform()
  • an origin and spacing to define the geometry

BaseGeometry and its sub-classes allow converting between intrinsic coordinates (called index or unit coordinates) and world-coordinates (called world or mm coordinates), e.g. WorldToIndex. In case you need integer index coordinates, provide an mitk::Index3D (or itk::Index) as target variable to WorldToIndex, otherwise you will get a continuous index (floating point values).

An important sub-class is SlicedGeometry3D, which descibes data objects consisting of slices, e.g., objects of type Image. Conversions between world coordinates (in mm) and unit coordinates (e.g., pixels in the case of an Image) can be performed.

For more information on related classes, see Geometry Classes.

BaseGeometry instances referring to an Image need a slightly different definition of corners, see SetImageGeometry. This is usualy automatically called by Image.

BaseGeometry have to be initialized in the method GenerateOutputInformation() of BaseProcess (or CopyInformation/ UpdateOutputInformation of BaseData, if possible, e.g., by analyzing pic tags in Image) subclasses. See also itk::ProcessObject::GenerateOutputInformation(), itk::DataObject::CopyInformation() and itk::DataObject::UpdateOutputInformation().

At least, it can return the bounding box of the data object.

The BaseGeometry class is an abstract class. The most simple implementation is the sublass Geometry3D.

Rule: everything is in mm (ms) if not stated otherwise.

Definition at line 101 of file mitkBaseGeometry.h.

Member Typedef Documentation

typedef BoundingBoxType::Pointer mitk::BaseGeometry::BoundingBoxPointer

Definition at line 112 of file mitkBaseGeometry.h.

Definition at line 110 of file mitkBaseGeometry.h.

typedef BoundingBoxType::BoundsArrayType mitk::BaseGeometry::BoundsArrayType

Definition at line 111 of file mitkBaseGeometry.h.

Definition at line 104 of file mitkBaseGeometry.h.

typedef itk::Object mitk::BaseGeometry::Superclass

Definition at line 104 of file mitkBaseGeometry.h.

Constructor & Destructor Documentation

mitk::BaseGeometry::BaseGeometry ( )
protected

Definition at line 35 of file mitkBaseGeometry.cpp.

References Initialize().

mitk::BaseGeometry::BaseGeometry ( const BaseGeometry other)
protected

Definition at line 48 of file mitkBaseGeometry.cpp.

References GetGeometryTransformHolder(), and InitializeGeometry().

mitk::BaseGeometry::~BaseGeometry ( )
protectedvirtual

Definition at line 61 of file mitkBaseGeometry.cpp.

Member Function Documentation

void mitk::BaseGeometry::_SetSpacing ( const mitk::Vector3D aSpacing,
bool  enforceSetSpacing = false 
)
protected

Definition at line 216 of file mitkBaseGeometry.cpp.

Referenced by mitk::SlicedGeometry3D::PreSetSpacing().

mitk::BoundingBox::Pointer mitk::BaseGeometry::CalculateBoundingBoxRelativeToTransform ( const mitk::AffineTransform3D transform) const

Calculates a bounding-box around the geometry relative to a coordinate system defined by a transform.

Definition at line 622 of file mitkBaseGeometry.cpp.

References mitk::New().

Referenced by mitk::BoundingObjectCutter::GenerateOutputInformation(), mitk::BoundingShapeCropper::GenerateOutputInformation(), and testExpectedAxisParallelBoundingBox().

void mitk::BaseGeometry::ChangeImageGeometryConsideringOriginOffset ( const bool  isAnImageGeometry)
virtual

When switching from an Image Geometry to a normal Geometry (and the other way around), you have to.

Reimplemented in mitk::SlicedGeometry3D.

Definition at line 709 of file mitkBaseGeometry.cpp.

References mitk::FillVector3D().

Referenced by mitk::SlicedGeometry3D::ChangeImageGeometryConsideringOriginOffset().

virtual void mitk::BaseGeometry::CheckBounds ( const BoundsArrayType )
inlineprotectedvirtual

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

Definition at line 588 of file mitkBaseGeometry.h.

virtual void mitk::BaseGeometry::CheckIndexToWorldTransform ( mitk::AffineTransform3D )
inlineprotectedvirtual

CheckIndexToWorldTransform.

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

Reimplemented in mitk::PlaneGeometry.

Definition at line 596 of file mitkBaseGeometry.h.

void mitk::BaseGeometry::Compose ( const TransformType other,
bool  pre = 0 
)

Compose new IndexToWorldTransform with a given transform.

This method composes m_IndexToWorldTransform with another transform, modifying self to be the composition of self and other. If the argument pre is true, then other is precomposed with self; that is, the resulting transformation consists of first applying other to the source, followed by self. If pre is false or omitted, then other is post-composed with self; that is the resulting transformation consists of first applying self to the source, followed by other. This method also changes m_spacing.

Definition at line 493 of file mitkBaseGeometry.cpp.

void mitk::BaseGeometry::Compose ( const vtkMatrix4x4 *  vtkmatrix,
bool  pre = 0 
)

Compose new IndexToWorldTransform with a given vtkMatrix4x4.

Converts the vtkMatrix4x4 into a itk-transform and calls the previous method.

Definition at line 500 of file mitkBaseGeometry.cpp.

References mitk::New(), and mitk::TransferVtkMatrixToItkTransform().

virtual std::vector<std::string> mitk::BaseGeometry::GetClassHierarchy ( ) const
inlinevirtual
mitk::Point3D mitk::BaseGeometry::GetCornerPoint ( bool  xFront = true,
bool  yFront = true,
bool  zFront = true 
) const

Get the position of a corner (in world coordinates)

See SetImageGeometry for how a corner is defined on images.

Definition at line 343 of file mitkBaseGeometry.cpp.

References mitk::FillVector3D().

double mitk::BaseGeometry::GetDiagonalLength ( ) const

Get the length of the diagonal of the bounding-box in mm.

Definition at line 290 of file mitkBaseGeometry.cpp.

Referenced by mitk::PlaneGeometryDataVtkMapper3D::GenerateDataForRenderer().

double mitk::BaseGeometry::GetDiagonalLength2 ( ) const

Get the squared length of the diagonal of the bounding-box in mm.

Definition at line 284 of file mitkBaseGeometry.cpp.

virtual unsigned int mitk::BaseGeometry::GetFrameOfReferenceID ( ) const
virtual

Get the DICOM FrameOfReferenceID referring to the used world coordinate system.

Referenced by mitk::Equal(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), and mitk::Geometry3DToXML::ToXML().

const mitk::GeometryTransformHolder * mitk::BaseGeometry::GetGeometryTransformHolder ( ) const

Definition at line 820 of file mitkBaseGeometry.cpp.

Referenced by BaseGeometry().

mitk::AffineTransform3D * mitk::BaseGeometry::GetIndexToWorldTransform ( )

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

Definition at line 810 of file mitkBaseGeometry.cpp.

Referenced by mitk::PlanePositionManagerService::AddNewPlanePosition(), mitk::PaintbrushTool::CheckIfCurrentSliceHasChanged(), mitk::PythonService::CopyToPythonAsSimpleItkImage(), doMITKMap(), mitk::TestDCMLoading::DumpImageInformation(), mitk::TestDICOMLoading::DumpImageInformation(), mitk::Equal(), mitk::BoundingObject::FitGeometry(), mitk::ItkImageFileReader::GenerateData(), mitk::NrrdTbssRoiImageReader::GenerateData(), mitk::HeightFieldSurfaceClipImageFilter::GenerateData(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::PlanarFigureWriter::GenerateData(), mitk::PlaneGeometryDataToSurfaceFilter::GenerateOutputInformation(), mitk::BoundingObjectCutter::GenerateOutputInformation(), mitk::BoundingShapeCropper::GenerateOutputInformation(), mitk::PlaneGeometry::GetNormal(), mitk::PlaneGeometry::GetNormalVnl(), mitk::GetRotation(), mitk::GetWorldToItkPhysicalTransform(), mitk::TbssImporter::Import(), mitk::Image::InitializeByItk(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::SlicedGeometry3D::InitializePlanes(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::PartialVolumeAnalysisHistogramCalculator::InternalReorientImagePlane(), mitk::Image::IsRotated(), main(), mitk::PlaneGeometry::Map(), mitk::PlaneGeometry::Project(), mitk::ItkImageIO::Read(), mitk::LabelSetImageIO::Read(), mitk::PlaneGeometry::SetMatrixByVectors(), testSurfaceBoundingBoxConsistency(), mitk::Geometry3DToXML::ToXML(), and mitk::ImageWriter::WriteByITK().

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

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

Definition at line 815 of file mitkBaseGeometry.cpp.

virtual unsigned long mitk::BaseGeometry::GetIndexToWorldTransformLastModified ( ) const
virtual
mitk::VnlVector mitk::BaseGeometry::GetMatrixColumn ( unsigned int  direction) const

Get a VnlVector along bounding-box in the specified direction, length is spacing.

See also
GetAxisVector

Definition at line 617 of file mitkBaseGeometry.cpp.

Referenced by mitk::PlaneGeometry::Angle(), and mitk::ConnectomicsNetworkWriter::Write().

virtual unsigned int mitk::BaseGeometry::GetNDimensions ( ) const
protectedvirtual
const mitk::Point3D mitk::BaseGeometry::GetOrigin ( ) const

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

Definition at line 71 of file mitkBaseGeometry.cpp.

Referenced by mitk::SliceNavigationController::AdjustSliceStepperRange(), Assert_ImageMetaData_AreEqual(), mitk::PythonService::CopyToPythonAsSimpleItkImage(), TrackVisFiberReader::create(), mitk::ContourModelMapper2D::CreateVtkPolyDataFromContour(), doMITKMap(), mitk::TestDCMLoading::DumpImageInformation(), mitk::TestDICOMLoading::DumpImageInformation(), mitk::Equal(), mitk::ImageStatisticsCalculator::ExtractImageAndMask(), mitk::PadImageFilter::GenerateData(), mitk::ExtractDirectedPlaneImageFilter::GenerateData(), mitk::ExtractSliceFilter::GenerateData(), mitk::PlanarFigureWriter::GenerateData(), mitk::SurfaceVtkMapper2D::GenerateDataForRenderer(), mitk::PlaneGeometryDataToSurfaceFilter::GenerateOutputInformation(), mitk::TbssImporter::Import(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::PartialVolumeAnalysisHistogramCalculator::InternalReorientImagePlane(), mitk::SliceBasedInterpolationController::Interpolate(), mitk::SegmentationInterpolationController::Interpolate(), mitk::PlaneGeometry::IntersectionLine(), mitk::PlaneGeometry::IntersectionPoint(), mitk::PlaneGeometry::IntersectionPointParam(), mitk::PlaneGeometry::IsOnPlane(), main(), mitk::SlicedGeometry3D::PreSetSpacing(), mitk::SlicedGeometry3D::ReinitializePlanes(), mitk::vtkSimulationPolyDataMapper2D::Render(), mitk::PlaneGeometry::SignedDistanceFromPlane(), testIndexAndWorldConsistency(), testIndexAndWorldConsistencyForVectors(), mitk::SegTool2D::UpdateSurfaceInterpolation(), mitk::ConnectomicsNetworkWriter::Write(), and mitk::ImageWriter::WriteByITK().

mitk::VnlVector mitk::BaseGeometry::GetOriginVnl ( ) const

Get the origin as VnlVector.

See also
GetOrigin

Definition at line 475 of file mitkBaseGeometry.cpp.

const mitk::Vector3D mitk::BaseGeometry::GetSpacing ( ) const

Get the spacing (size of a pixel).

Definition at line 87 of file mitkBaseGeometry.cpp.

Referenced by mitk::LabeledImageVolumeCalculator::_InternalCalculateVolumes(), mitk::SegTool2D::AddContourmarker(), mitk::PlanePositionManagerService::AddNewPlanePosition(), mitk::PlaneClipping::CalculateClippedPlaneBounds(), mitk::ExtractDirectedPlaneImageFilter::CalculateClippedPlaneBounds(), mitk::ImageDataItem::ConstructVtkImageData(), mitk::PythonService::CopyToPythonAsSimpleItkImage(), TrackVisFiberReader::create(), mitk::PlaneGeometryDataMapper2D::CreateVtkCrosshair(), mitk::PointSetVtkMapper2D::CreateVTKRenderObjects(), doMITKMap(), mitk::TestDCMLoading::DumpImageInformation(), mitk::TestDICOMLoading::DumpImageInformation(), mitk::Equal(), mitk::DicomSeriesReader::FixSpacingInformation(), mitk::ImageToIGTLMessageFilter::GenerateData(), mitk::PadImageFilter::GenerateData(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::PlanarFigureWriter::GenerateData(), mitk::GetRotation(), mitk::LabeledImageToSurfaceFilter::GetVolumeForLabel(), mitk::TbssImporter::Import(), mitk::SlicedGeometry3D::InitializePlanes(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::LabelSetImageToSurfaceFilter::InternalProcessing(), mitk::PartialVolumeAnalysisHistogramCalculator::InternalReorientImagePlane(), main(), mitk::SliceNavigationController::SelectSliceByPoint(), QmitkSlicesInterpolator::SetCurrentContourListID(), mitk::SlicedGeometry3D::SlicedGeometry3D(), testIndexAndWorldConsistency(), mitk::ConnectomicsNetworkWriter::Write(), and mitk::ImageWriter::WriteByITK().

static const char* mitk::BaseGeometry::GetStaticNameOfClass ( )
inlinestatic

Definition at line 104 of file mitkBaseGeometry.h.

const std::string mitk::BaseGeometry::GetTransformAsString ( TransformType transformType)
staticprotected

Definition at line 650 of file mitkBaseGeometry.cpp.

vtkMatrix4x4 * mitk::BaseGeometry::GetVtkMatrix ( )
virtual void mitk::BaseGeometry::ImageGeometryOff ( )
virtual
virtual void mitk::BaseGeometry::ImageGeometryOn ( )
virtual
void mitk::BaseGeometry::IndexToWorld ( const mitk::Point3D pt_units,
mitk::Point3D pt_mm 
) const

Convert (continuous or discrete) index coordinates of a point to world coordinates (in mm) For further information about coordinates types, please see the Geometry documentation.

Definition at line 515 of file mitkBaseGeometry.cpp.

template<unsigned int VIndexDimension>
void mitk::BaseGeometry::IndexToWorld ( const itk::Index< VIndexDimension > &  index,
mitk::Point3D pt_mm 
) const
inline

Convert (discrete) index coordinates of a point to world coordinates (in mm) For further information about coordinates types, please see the Geometry documentation.

Definition at line 304 of file mitkBaseGeometry.h.

void mitk::BaseGeometry::IndexToWorld ( const mitk::Point3D atPt3d_units,
const mitk::Vector3D vec_units,
mitk::Vector3D vec_mm 
) const

Convert (continuous or discrete) index coordinates of a vector vec_units to world coordinates (in mm)

Deprecated:
First parameter (Point3D) is not used. If possible, please use void IndexToWorld(const

Definition at line 684 of file mitkBaseGeometry.cpp.

References MITK_WARN.

void mitk::BaseGeometry::InitializeGeometry ( Self newGeometry) const

Initialize the geometry

Definition at line 125 of file mitkBaseGeometry.cpp.

References SetBounds(), and SetFrameOfReferenceID().

Referenced by BaseGeometry().

virtual itk::LightObject::Pointer mitk::BaseGeometry::InternalClone ( ) const
overrideprotectedpure virtual

clones the geometry

Overwrite in all sub-classes. Normally looks like:

//## Self::Pointer newGeometry = new Self(*this);
//## newGeometry->UnRegister();
//## return newGeometry.GetPointer();
//##

Implemented in mitk::PlaneGeometry, mitk::SlicedGeometry3D, mitk::AbstractTransformGeometry, mitk::Geometry3D, mitk::LandmarkProjectorBasedCurvedGeometry, and mitk::ThinPlateSplineCurvedGeometry.

bool mitk::BaseGeometry::Is2DConvertable ( )
virtual

Checks, if the given geometry can be converted to 2D without information loss e.g. when a 2D image is saved, the matrix is usually cropped to 2x2, and when you load it back to MITK it will be filled with standard values. This function checks, if information would be lost during this procedure.

Definition at line 238 of file mitkBaseGeometry.cpp.

Referenced by mitk::ItkImageIO::GetWriterConfidenceLevel().

bool mitk::BaseGeometry::IsBoundingBoxNull ( ) const
protected

Definition at line 699 of file mitkBaseGeometry.cpp.

Referenced by mitk::PlaneGeometry::Map(), and mitk::PlaneGeometry::Project().

bool mitk::BaseGeometry::IsIndexInside ( const mitk::Point3D index) const

Test whether the point p ((continous!)index coordinates in units) is inside the bounding box.

Definition at line 396 of file mitkBaseGeometry.cpp.

Referenced by mitk::SetRegionTool::OnMousePressed(), QmitkAdaptiveRegionGrowingToolGUI::OnPointAdded(), and mitk::ContourModelUtils::ProjectContourTo2DSlice().

template<unsigned int VIndexDimension>
bool mitk::BaseGeometry::IsIndexInside ( const itk::Index< VIndexDimension > &  index) const
inline

Convenience method for working with ITK indices.

Definition at line 498 of file mitkBaseGeometry.h.

bool mitk::BaseGeometry::IsIndexToWorldTransformNull ( ) const
protected

Definition at line 704 of file mitkBaseGeometry.cpp.

bool mitk::BaseGeometry::IsValid ( ) const
virtual
template<class TCoordRep >
void mitk::BaseGeometry::ItkPhysicalPointToWorld ( const itk::Point< TCoordRep, 3 > &  itkPhysicalPoint,
mitk::Point3D pt_mm 
) const
inline

Deprecated for use with ITK version 3.10 or newer. Convert ITK physical coordinates of a point (in mm, but without a rotation) into MITK world coordinates (in mm)

For more information, see WorldToItkPhysicalPoint.

Definition at line 344 of file mitkBaseGeometry.h.

References mitk::vtk2itk().

void mitk::BaseGeometry::Modified ( ) const
override

Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class.

For the use of Modified(), see class ModifiedLock.

Definition at line 802 of file mitkBaseGeometry.cpp.

Referenced by mitk::PlaneGeometry::ExecuteOperation(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), and mitk::BaseRenderer::SetCurrentWorldPlaneGeometry().

virtual void mitk::BaseGeometry::PreSetSpacing ( const mitk::Vector3D )
inlineprotectedvirtual

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 in mitk::PlaneGeometry, mitk::SlicedGeometry3D, mitk::AbstractTransformGeometry, mitk::Geometry3D, mitk::LandmarkProjectorBasedCurvedGeometry, and mitk::ThinPlateSplineCurvedGeometry.

Definition at line 578 of file mitkBaseGeometry.h.

void mitk::BaseGeometry::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotectedvirtual

Reimplemented in mitk::PlaneGeometry, and mitk::SlicedGeometry3D.

Definition at line 739 of file mitkBaseGeometry.cpp.

Referenced by mitk::PlaneGeometry::PrintSelf().

void mitk::BaseGeometry::SetBounds ( const BoundsArrayType bounds)
void mitk::BaseGeometry::SetExtentInMM ( int  direction,
ScalarType  extentInMM 
)

Set the extent of the bounding-box in the specified direction in mm.

Note
This changes the matrix in the transform, not the bounds, which are given in units!

Definition at line 368 of file mitkBaseGeometry.cpp.

References mitk::eps.

Referenced by mitk::PlaneGeometry::SetSizeInUnits().

void mitk::BaseGeometry::SetFloatBounds ( const float  bounds[6])

Set the bounding box (in index/unit coordinates) via a float array.

Definition at line 104 of file mitkBaseGeometry.cpp.

void mitk::BaseGeometry::SetFloatBounds ( const double  bounds[6])

Set the bounding box (in index/unit coordinates) via a double array.

Definition at line 114 of file mitkBaseGeometry.cpp.

virtual void mitk::BaseGeometry::SetFrameOfReferenceID ( unsigned int  _arg)
virtual

Set the DICOM FrameOfReferenceID referring to the used world coordinate system.

Referenced by InitializeGeometry().

void mitk::BaseGeometry::SetIdentity ( )

Set the transform to identity, the spacing to 1 and origin to 0.

Definition at line 485 of file mitkBaseGeometry.cpp.

virtual void mitk::BaseGeometry::SetImageGeometry ( bool  _arg)
virtual

Define that this BaseGeometry is refering to an Image.

A geometry referring to an Image needs a slightly different definition of the position of the corners (see GetCornerPoint). The position of a voxel is defined by the position of its center. If we would use the origin (position of the (center of) the first voxel) as a corner and display this point, it would seem to be not at the corner but a bit within the image. Even worse for the opposite corner of the image: here the corner would appear outside the image (by half of the voxel diameter). Thus, we have to correct for this and to be able to do that, we need to know that the BaseGeometry is referring to an Image.

Reimplemented in mitk::SlicedGeometry3D.

Referenced by mitk::SlicedGeometry3D::SetImageGeometry().

void mitk::BaseGeometry::SetIndexToWorldTransformByVtkMatrix ( vtkMatrix4x4 *  vtkmatrix)

Convenience method for setting the ITK transform (m_IndexToWorldTransform) via an vtkMatrix4x4.The spacing of the new transform is copied to m_spacing.

See also
SetIndexToWorldTransform

Definition at line 674 of file mitkBaseGeometry.cpp.

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

Convenience method for setting the ITK transform (m_IndexToWorldTransform) via an vtkMatrix4x4. This function keeps the original spacing.

See also
SetIndexToWorldTransform

Definition at line 679 of file mitkBaseGeometry.cpp.

void mitk::BaseGeometry::SetIndexToWorldTransformWithoutChangingSpacing ( mitk::AffineTransform3D transform)

Definition at line 179 of file mitkBaseGeometry.cpp.

References mitk::Equal(), and MITK_WARN.

void mitk::BaseGeometry::SetVtkMatrixDeepCopy ( vtkTransform *  vtktransform)
protected

Definition at line 66 of file mitkBaseGeometry.cpp.

Referenced by mitk::PlaneGeometry::ExecuteOperation().

void mitk::BaseGeometry::Translate ( const Vector3D vector)

Translate the origin by a vector.

Definition at line 507 of file mitkBaseGeometry.cpp.

Referenced by mitk::AffineBaseDataInteractor3D::TranslateGeometry().

void mitk::BaseGeometry::WorldToIndex ( const mitk::Point3D pt_mm,
mitk::Point3D pt_units 
) const

Convert world coordinates (in mm) of a point to (continuous!) index coordinates.

Warning
If you need (discrete) integer index coordinates (e.g., for iterating easily over an image), use WorldToIndex(const mitk::Point3D& pt_mm, itk::Index<VIndexDimension> &index). For further information about coordinates types, please see the Geometry documentation

Definition at line 424 of file mitkBaseGeometry.cpp.

References offset.

Referenced by QmitkSlicesInterpolator::AcceptAllInterpolations(), AddPointToPath(), mitk::AffineImageCropperInteractor::CheckOverObject(), ComputeIntensityProfile(), mitk::PlaneGeometryDataMapper2D::CutCrossLineWithReferenceGeometry(), mitk::SegTool2D::DetermineAffectedImageSlice(), mitk::PointSet::ExecuteOperation(), mitk::ImageStatisticsCalculator::ExtractImageAndMask(), mitk::ContourModelSetToImageFilter::GenerateData(), mitk::ImagePixelWriteAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates(), mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates(), mitk::PointSet::InsertPoint(), mitk::PartialVolumeAnalysisHistogramCalculator::InternalCalculateMaskFromPlanarFigure(), mitk::ImageStatisticsCalculator::InternalCalculateMaskFromPlanarFigure(), mitk::PartialVolumeAnalysisHistogramCalculator::InternalReorientImagePlane(), mitk::PlaneGeometry::IsAbove(), mitk::PlaneGeometry::Map(), mitk::SetRegionTool::OnMousePressed(), QmitkAdaptiveRegionGrowingToolGUI::OnPointAdded(), mitk::PlaneGeometry::Project(), mitk::ContourModelUtils::ProjectContourTo2DSlice(), mitk::PickingTool::StartRegionGrowing(), testIndexAndWorldConsistency(), testIndexAndWorldConsistencyForIndex(), and testIndexAndWorldConsistencyForVectors().

void mitk::BaseGeometry::WorldToIndex ( const mitk::Vector3D vec_mm,
mitk::Vector3D vec_units 
) const

Convert world coordinates (in mm) of a vector vec_mm to (continuous!) index coordinates. For further information about coordinates types, please see the Geometry documentation.

Definition at line 435 of file mitkBaseGeometry.cpp.

References mitk::New().

template<unsigned int VIndexDimension>
void mitk::BaseGeometry::WorldToIndex ( const mitk::Point3D pt_mm,
itk::Index< VIndexDimension > &  index 
) const
inline

Convert world coordinates (in mm) of a point to (discrete!) index coordinates. This method rounds to integer indices! For further information about coordinates types, please see the Geometry documentation.

Definition at line 272 of file mitkBaseGeometry.h.

void mitk::BaseGeometry::WorldToIndex ( const mitk::Point3D atPt3d_mm,
const mitk::Vector3D vec_mm,
mitk::Vector3D vec_units 
) const

Convert world coordinates (in mm) of a vector vec_mm to (continuous!) index coordinates.

Deprecated:
First parameter (Point3D) is not used. If possible, please use void WorldToIndex(const

Definition at line 466 of file mitkBaseGeometry.cpp.

References MITK_WARN.

template<class TCoordRep >
void mitk::BaseGeometry::WorldToItkPhysicalPoint ( const mitk::Point3D pt_mm,
itk::Point< TCoordRep, 3 > &  itkPhysicalPoint 
) const
inline

Deprecated for use with ITK version 3.10 or newer. Convert world coordinates (in mm) of a point to ITK physical coordinates (in mm, but without a possible rotation)

This method is useful if you have want to access an mitk::Image via an itk::Image. ITK v3.8 and older did not support rotated (tilted) images, i.e., ITK images are always parallel to the coordinate axes. When accessing a (possibly rotated) mitk::Image via an itk::Image the rotational part of the transformation in the BaseGeometry is simply discarded; in other word: only the origin and spacing is used by ITK, not the complete matrix available in MITK. With WorldToItkPhysicalPoint you can convert an MITK world coordinate (including the rotation) into a coordinate that can be used with the ITK image as a ITK physical coordinate (excluding the rotation).

Definition at line 366 of file mitkBaseGeometry.h.

References mitk::vtk2itk().


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