Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
BaseGeometry Describes the geometry of a data object. More...
#include <mitkBaseGeometry.h>
Public Types | |
typedef BaseGeometry | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef GeometryTransformHolder::TransformType | TransformType |
typedef itk::BoundingBox< unsigned long, 3, ScalarType > | BoundingBoxType |
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::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. 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=false) |
Compose new IndexToWorldTransform with a given transform. More... | |
void | Compose (const vtkMatrix4x4 *vtkmatrix, bool pre=false) |
Compose new IndexToWorldTransform with a given vtkMatrix4x4. More... | |
void | Translate (const Vector3D &vector) |
Translate the origin by a vector. More... | |
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 BoundingBoxType * | GetBoundingBox () |
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 GeometryTransformHolder * | GetGeometryTransformHolder () const |
![]() | |
itkTypeMacroNoParent (OperationActor) virtual ~OperationActor() | |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
BaseGeometry () | |
BaseGeometry (const BaseGeometry &other) | |
~BaseGeometry () override | |
itk::LightObject::Pointer | InternalClone () const override=0 |
clones the geometry More... | |
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) |
BaseGeometry Describes the geometry of a data object.
The class holds
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 97 of file mitkBaseGeometry.h.
typedef BoundingBoxType::Pointer mitk::BaseGeometry::BoundingBoxPointer |
Definition at line 108 of file mitkBaseGeometry.h.
typedef itk::BoundingBox<unsigned long, 3, ScalarType> mitk::BaseGeometry::BoundingBoxType |
Definition at line 106 of file mitkBaseGeometry.h.
typedef BoundingBoxType::BoundsArrayType mitk::BaseGeometry::BoundsArrayType |
Definition at line 107 of file mitkBaseGeometry.h.
typedef itk::SmartPointer<const Self> mitk::BaseGeometry::ConstPointer |
Definition at line 100 of file mitkBaseGeometry.h.
Definition at line 100 of file mitkBaseGeometry.h.
typedef BaseGeometry mitk::BaseGeometry::Self |
Definition at line 100 of file mitkBaseGeometry.h.
typedef itk::Object mitk::BaseGeometry::Superclass |
Definition at line 100 of file mitkBaseGeometry.h.
Definition at line 101 of file mitkBaseGeometry.h.
|
protected |
Definition at line 31 of file mitkBaseGeometry.cpp.
References Initialize().
|
protected |
Definition at line 44 of file mitkBaseGeometry.cpp.
References GetGeometryTransformHolder(), and InitializeGeometry().
|
overrideprotected |
Definition at line 57 of file mitkBaseGeometry.cpp.
|
protected |
Definition at line 212 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::SetSpacing().
Referenced by mitk::SlicedGeometry3D::PreSetSpacing(), and SetSpacing().
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 618 of file mitkBaseGeometry.cpp.
References GetCornerPoint().
Referenced by mitk::BoundingObjectCutter::GenerateOutputInformation(), mitk::BoundingShapeCropper::GenerateOutputInformation(), and testExpectedAxisParallelBoundingBox().
|
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 705 of file mitkBaseGeometry.cpp.
References mitk::FillVector3D(), GetBoundingBox(), GetIndexToWorldTransform(), SetImageGeometry(), and SetOrigin().
Referenced by mitk::SlicedGeometry3D::ChangeImageGeometryConsideringOriginOffset().
|
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 585 of file mitkBaseGeometry.h.
Referenced by SetBounds().
|
inlineprotectedvirtual |
CheckIndexToWorldTransform.
This function is called in SetIndexToWorldTransform. Assertions can be implemented in this function (see
Reimplemented in mitk::PlaneGeometry.
Definition at line 593 of file mitkBaseGeometry.h.
References DEPRECATED, mitk::eps, mitk::Equal(), MITKCORE_EXPORT, and verbose().
Referenced by SetIndexToWorldTransform(), and SetIndexToWorldTransformWithoutChangingSpacing().
Pointer mitk::BaseGeometry::Clone | ( | ) | const |
Referenced by mitk::ArbitraryTimeGeometry::AppendNewTimeStepClone(), mitk::DiffSliceOperation::DiffSliceOperation(), mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), mitk::HeightFieldSurfaceClipImageFilter::GenerateOutputInformation(), mitk::ProportionalTimeGeometry::Initialize(), mitk::Image::Initialize(), mitk::RenderingManager::InitializeView(), mitk::RenderingManager::InitializeViews(), mitk::AffineBaseDataInteractor3D::InitMembers(), mitk::ClippingPlaneInteractor3D::InitRotate(), mitk::ClippingPlaneInteractor3D::InitTranslate(), mitk::ImageMappingHelper::map(), mitk::ProportionalTimeGeometry::ReplaceTimeStepGeometries(), mitk::ArbitraryTimeGeometry::ReplaceTimeStepGeometries(), mitk::BaseData::SetClonedGeometry(), and mitk::AbstractTransformGeometry::SetFrameGeometry().
void mitk::BaseGeometry::Compose | ( | const TransformType * | other, |
bool | pre = false |
||
) |
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 489 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::Compose(), and Modified().
Referenced by Compose(), and mitk::BoundingObject::FitGeometry().
void mitk::BaseGeometry::Compose | ( | const vtkMatrix4x4 * | vtkmatrix, |
bool | pre = false |
||
) |
Compose new IndexToWorldTransform with a given vtkMatrix4x4.
Converts the vtkMatrix4x4 into a itk-transform and calls the previous method.
Definition at line 496 of file mitkBaseGeometry.cpp.
References Compose(), and mitk::TransferVtkMatrixToItkTransform().
|
overridevirtual |
executes affine operations (translate, rotate, scale)
Implements mitk::OperationActor.
Reimplemented in mitk::PlaneGeometry, and mitk::SlicedGeometry3D.
Definition at line 521 of file mitkBaseGeometry.cpp.
References GetMatrixColumn(), mitk::Operation::GetOperationType(), GetVtkMatrix(), MITK_ERROR, Modified(), mitk::OpAPPLYTRANSFORMMATRIX, mitk::OpMOVE, mitk::OpNOTHING, mitk::OpRESTOREPLANEPOSITION, mitk::OpROTATE, mitk::OpSCALE, SetVtkMatrixDeepCopy(), and mitk::TransferItkTransformToVtkMatrix().
Referenced by mitk::SlicedGeometry3D::ExecuteOperation(), mitk::PlaneGeometry::ExecuteOperation(), mitk::AffineBaseDataInteractor3D::RotateGeometry(), and mitk::AffineBaseDataInteractor3D::ScaleGeometry().
mitk::Vector3D mitk::BaseGeometry::GetAxisVector | ( | unsigned int | direction | ) | const |
Get vector along bounding-box in the specified direction in mm.
The length of the vector is the size of the bounding-box in the specified direction in mm
Definition at line 217 of file mitkBaseGeometry.cpp.
References GetExtent(), and GetIndexToWorldTransform().
Referenced by mitk::CameraController::AdjustCameraToPlane(), mitk::PlanarFigureMaskGenerator::CheckPlanarFigureIsNotTilted(), mitk::SegTool2D::DetermineAffectedImageSlice(), mitk::Equal(), mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::SlicedGeometry3D::InitializePlanes(), mitk::SlicedGeometry3D::PreSetSpacing(), mitk::SlicedGeometry3D::ReinitializePlanes(), mitk::AffineBaseDataInteractor3D::RotateGeometry(), testGetAxisVectorExtent(), testGetAxisVectorVariants(), and testIndexAndWorldConsistencyForVectors().
|
virtual |
Get the bounding box
Referenced by mitk::PlaneClipping::CalculateClippedPlaneBounds(), mitk::ExtractDirectedPlaneImageFilter::CalculateClippedPlaneBounds(), ChangeImageGeometryConsideringOriginOffset(), mitk::Equal(), mitk::PlaneGeometryDataVtkMapper3D::GenerateDataForRenderer(), mitk::SlicedGeometry3D::GetBoundingBox(), GetCornerPoint(), mitk::PlaneGeometry::IsAbove(), IsIndexInside(), mitk::PlaneGeometry::Map(), PrintSelf(), mitk::AbstractTransformGeometry::Project(), mitk::PlaneGeometry::Project(), mitk::SliceNavigationController::SetInputWorldGeometry3D(), mitk::BaseRenderer::SetWorldGeometry3D(), testExpectedIndexBoundingBox(), and testIndexAndWorldConsistency().
const mitk::BaseGeometry::BoundsArrayType mitk::BaseGeometry::GetBounds | ( | ) | const |
Definition at line 195 of file mitkBaseGeometry.cpp.
Referenced by mitk::PlanarCircle::ApplyControlPointConstraints(), mitk::PlanarEllipse::ApplyControlPointConstraints(), mitk::PlanarFigure::ApplyControlPointConstraints(), mitk::PlaneGeometryDataMapper2D::CutCrossLineWithPlaneGeometry(), doMITKMap(), mitk::Generate3DDeformationGlyph(), mitk::Generate3DDeformationGrid(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::PlaneGeometry::IsAbove(), mitk::SlicedGeometry3D::PreSetSpacing(), mitk::PlaneGeometryDataMapper2D::TestPointInPlaneGeometry(), and mitk::Geometry3DToXML::ToXML().
mitk::Point3D mitk::BaseGeometry::GetCenter | ( | ) | const |
Get the center of the bounding-box in mm.
Definition at line 264 of file mitkBaseGeometry.cpp.
References IndexToWorld().
Referenced by mitk::SegTool2D::DetermineAffectedImageSlice(), mitk::SlicedGeometry3D::ExecuteOperation(), mitk::BoundingObject::FitGeometry(), mitk::ContourModelSetGLMapper2D::MitkRender(), and testIndexAndWorldConsistency().
|
inlinevirtual |
Reimplemented in mitk::PlaneGeometry, mitk::SlicedGeometry3D, mitk::AbstractTransformGeometry, mitk::Geometry3D, mitk::LandmarkProjectorBasedCurvedGeometry, and mitk::ThinPlateSplineCurvedGeometry.
Definition at line 100 of file mitkBaseGeometry.h.
|
virtual |
mitk::Point3D mitk::BaseGeometry::GetCornerPoint | ( | int | id | ) | const |
Get the position of the corner number id (in world coordinates)
See SetImageGeometry for how a corner is defined on images.
Definition at line 291 of file mitkBaseGeometry.cpp.
References mitk::FillVector3D(), GetBoundingBox(), GetIndexToWorldTransform(), and IsBoundingBoxNull().
Referenced by CalculateBoundingBoxRelativeToTransform(), mitk::PlaneGeometryDataMapper2D::CutCrossLineWithReferenceGeometry(), mitk::ItkImageFileReader::GenerateData(), GetDiagonalLength2(), mitk::ItkImageIO::Read(), mitk::LabelSetImageIO::Read(), mitk::LabelSetImageVtkMapper2D::RenderingGeometryIntersectsImage(), mitk::RegEvaluationMapper2D::RenderingGeometryIntersectsImage(), mitk::DoseImageVtkMapper2D::RenderingGeometryIntersectsImage(), mitk::ImageVtkMapper2D::RenderingGeometryIntersectsImage(), and testGetAxisVectorVariants().
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 339 of file mitkBaseGeometry.cpp.
References mitk::FillVector3D(), GetBoundingBox(), GetIndexToWorldTransform(), and IsBoundingBoxNull().
double mitk::BaseGeometry::GetDiagonalLength | ( | ) | const |
Get the length of the diagonal of the bounding-box in mm.
Definition at line 286 of file mitkBaseGeometry.cpp.
References GetDiagonalLength2().
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 280 of file mitkBaseGeometry.cpp.
References GetCornerPoint().
Referenced by GetDiagonalLength().
mitk::ScalarType mitk::BaseGeometry::GetExtent | ( | unsigned int | direction | ) | const |
Set the time bounds (in ms)
Get the extent of the bounding box
Definition at line 225 of file mitkBaseGeometry.cpp.
References mitkThrow.
Referenced by mitk::PlanePositionManagerService::AddNewPlanePosition(), mitk::Equal(), mitk::Generate3DDeformationGlyph(), mitk::Generate3DDeformationGrid(), mitk::ExtractDirectedPlaneImageFilter::GenerateData(), mitk::ExtractSliceFilter::GenerateOutputInformation(), GetAxisVector(), GetExtentInMM(), mitk::PlaneGeometry::IndexToWorld(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::SlicedGeometry3D::InitializePlanes(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::PlaneGeometry::Map(), mitk::PlaneGeometry::PrintSelf(), mitk::SlicedData::SetGeometry(), mitk::PlaneGeometry::SetSizeInUnits(), and mitk::PlaneGeometry::WorldToIndex().
mitk::ScalarType mitk::BaseGeometry::GetExtentInMM | ( | int | direction | ) | const |
Get the extent of the bounding-box in the specified direction in mm.
Equals length of GetAxisVector(direction).
Definition at line 358 of file mitkBaseGeometry.cpp.
References GetExtent(), and GetIndexToWorldTransform().
Referenced by mitk::PlanarFigureInteractor::CheckFigureOnRenderingGeometry(), mitk::CameraController::ComputeMaxParallelScale(), mitk::SlicedGeometry3D::ExecuteOperation(), mitk::CameraController::Fit(), mitk::BoundingObject::FitGeometry(), mitk::ExtractDirectedPlaneImageFilter::GenerateData(), mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), mitk::ExtractSliceFilter::GenerateOutputInformation(), mitk::Ellipsoid::GetVolume(), mitk::PlaneGeometry::IndexToWorld(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::PlaneGeometry::IntersectWithPlane2D(), mitk::PlaneGeometry::Map(), mitk::PlanarFigureMapper2D::MitkRender(), mitk::PlaneGeometry::PrintSelf(), mitk::SlicedGeometry3D::ReinitializePlanes(), SetExtentInMM(), mitk::PlaneGeometry::SetSizeInUnits(), testGetAxisVectorExtent(), mitk::PlanarFigureInteractor::TransformObjectToDisplay(), and mitk::PlaneGeometry::WorldToIndex().
|
virtual |
Get the DICOM FrameOfReferenceID referring to the used world coordinate system.
Referenced by mitk::Equal(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), InitializeGeometry(), and mitk::Geometry3DToXML::ToXML().
const mitk::GeometryTransformHolder * mitk::BaseGeometry::GetGeometryTransformHolder | ( | ) | const |
Definition at line 816 of file mitkBaseGeometry.cpp.
Referenced by BaseGeometry(), and InitializeGeometry().
|
virtual |
Is this an ImageGeometry?
For more information, see SetImageGeometry
Referenced by mitk::PlaneClipping::CalculateClippedPlaneBounds(), mitk::ExtractDirectedPlaneImageFilter::CalculateClippedPlaneBounds(), mitk::Equal(), mitk::PlaneGeometryDataVtkMapper3D::GenerateDataForRenderer(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::SlicedGeometry3D::PreSetSpacing(), PrintSelf(), mitk::Image::SetGeometry(), testIndexAndWorldConsistency(), and mitk::Geometry3DToXML::ToXML().
mitk::AffineTransform3D * mitk::BaseGeometry::GetIndexToWorldTransform | ( | ) |
Get the transformation used to convert from index to world coordinates.
Definition at line 806 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::GetIndexToWorldTransform().
Referenced by mitk::PlanePositionManagerService::AddNewPlanePosition(), mitk::SlicedGeometry3D::AdjustNormal(), ChangeImageGeometryConsideringOriginOffset(), mitk::PaintbrushTool::CheckIfCurrentSliceHasChanged(), Clone(), mitk::PythonService::CopyToPythonAsSimpleItkImage(), doMITKMap(), mitk::TestDICOMLoading::DumpImageInformation(), mitk::Equal(), mitk::BoundingObject::FitGeometry(), mitk::ItkImageFileReader::GenerateData(), mitk::HeightFieldSurfaceClipImageFilter::GenerateData(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::PlanarFigureWriter::GenerateData(), mitk::PlaneGeometryDataToSurfaceFilter::GenerateOutputInformation(), mitk::BoundingObjectCutter::GenerateOutputInformation(), mitk::BoundingShapeCropper::GenerateOutputInformation(), mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), mitk::ExtractSliceFilter::GenerateOutputInformation(), GetAxisVector(), GetCornerPoint(), GetExtentInMM(), GetMatrixColumn(), mitk::PlaneGeometry::GetNormal(), mitk::PlaneGeometry::GetNormalVnl(), mitk::GetRotation(), mitk::GetWorldToItkPhysicalTransform(), IndexToWorld(), mitk::Image::InitializeByItk(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::SlicedGeometry3D::InitializePlanes(), mitk::PlaneGeometry::InitializeStandardPlane(), Is2DConvertable(), mitk::Image::IsRotated(), mitk::PlaneGeometry::Map(), PrintSelf(), mitk::AbstractTransformGeometry::Project(), mitk::PlaneGeometry::Project(), mitk::ItkImageIO::Read(), mitk::LabelSetImageIO::Read(), mitk::PlaneGeometry::SetMatrixByVectors(), testSurfaceBoundingBoxConsistency(), mitk::Geometry3DToXML::ToXML(), mitk::BoundingObjectGroup::UpdateOutputInformation(), mitk::ContourSet::UpdateOutputInformation(), WorldToIndex(), 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 811 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::GetIndexToWorldTransform().
|
virtual |
mitk::VnlVector mitk::BaseGeometry::GetMatrixColumn | ( | unsigned int | direction | ) | const |
Get a VnlVector along bounding-box in the specified direction, length is spacing.
Definition at line 613 of file mitkBaseGeometry.cpp.
References GetIndexToWorldTransform().
Referenced by mitk::PlaneGeometry::Angle(), and ExecuteOperation().
|
protectedvirtual |
Referenced by mitk::AbstractTransformGeometry::SetParametricBounds().
const mitk::Point3D mitk::BaseGeometry::GetOrigin | ( | ) | const |
Get the origin, e.g. the upper-left corner of the plane.
Definition at line 67 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::GetOrigin().
Referenced by mitk::CameraController::AdjustCameraToPlane(), Assert_ImageMetaData_AreEqual(), mitk::PythonService::CopyToPythonAsSimpleItkImage(), mitk::ContourModelMapper2D::CreateVtkPolyDataFromContour(), doMITKMap(), mitk::TestDICOMLoading::DumpImageInformation(), mitk::Equal(), mitk::PadImageFilter::GenerateData(), mitk::SurfaceVtkMapper2D::GenerateDataForRenderer(), mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), GetOriginVnl(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::SliceBasedInterpolationController::Interpolate(), mitk::SegmentationInterpolationController::Interpolate(), mitk::PlaneGeometry::IntersectionLine(), mitk::PlaneGeometry::IntersectionPoint(), mitk::PlaneGeometry::IntersectionPointParam(), Is2DConvertable(), mitk::PlaneGeometry::IsOnPlane(), mitk::SlicedGeometry3D::PreSetSpacing(), PrintSelf(), mitk::SlicedGeometry3D::ReinitializePlanes(), mitk::BoundingShapeVtkMapper2D::SetDefaultProperties(), SetOrigin(), mitk::PlaneGeometry::SignedDistanceFromPlane(), testIndexAndWorldConsistency(), testIndexAndWorldConsistencyForVectors(), Translate(), mitk::SegTool2D::UpdateSurfaceInterpolation(), and mitk::ImageWriter::WriteByITK().
mitk::VnlVector mitk::BaseGeometry::GetOriginVnl | ( | ) | const |
Get the origin as VnlVector.
Definition at line 471 of file mitkBaseGeometry.cpp.
References GetOrigin().
const mitk::Vector3D mitk::BaseGeometry::GetSpacing | ( | ) | const |
Get the spacing (size of a pixel).
Definition at line 83 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::GetSpacing().
Referenced by mitk::LabeledImageVolumeCalculator::_InternalCalculateVolumes(), mitk::PlanePositionManagerService::AddNewPlanePosition(), mitk::PlaneClipping::CalculateClippedPlaneBounds(), mitk::ExtractDirectedPlaneImageFilter::CalculateClippedPlaneBounds(), mitk::SlicedGeometry3D::CalculateSpacing(), mitk::DisplayInteractor::CheckRotationPossible(), mitk::DisplayActionEventBroadcast::CheckRotationPossible(), mitk::ImageDataItem::ConstructVtkImageData(), mitk::PythonService::CopyToPythonAsSimpleItkImage(), mitk::LabeledImageToSurfaceFilter::CreateSurface(), mitk::ImageToSurfaceFilter::CreateSurface(), mitk::PlaneGeometryDataMapper2D::CreateVtkCrosshair(), mitk::PointSetVtkMapper2D::CreateVTKRenderObjects(), doMITKMap(), mitk::TestDICOMLoading::DumpImageInformation(), mitk::Equal(), mitk::SlicedGeometry3D::ExecuteOperation(), mitk::DicomSeriesReader::FixSpacingInformation(), mitk::ImageToIGTLMessageFilter::GenerateData(), mitk::PadImageFilter::GenerateData(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), mitk::DICOMImageBlockDescriptor::GetMitkImage(), mitk::SlicedGeometry3D::GetPlaneGeometry(), mitk::GetRotation(), mitk::LabeledImageToSurfaceFilter::GetVolumeForLabel(), mitk::SlicedGeometry3D::InitializePlanes(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::LabelSetImageToSurfaceFilter::InternalProcessing(), Is2DConvertable(), mitk::SlicedGeometry3D::PreSetSpacing(), PrintSelf(), mitk::SliceNavigationController::SelectSliceByPoint(), QmitkSlicesInterpolator::SetCurrentContourListID(), SetIndexToWorldTransformWithoutChangingSpacing(), mitk::SlicedGeometry3D::SlicedGeometry3D(), testIndexAndWorldConsistency(), and mitk::ImageWriter::WriteByITK().
|
inlinestatic |
Definition at line 100 of file mitkBaseGeometry.h.
|
staticprotected |
Definition at line 646 of file mitkBaseGeometry.cpp.
vtkMatrix4x4 * mitk::BaseGeometry::GetVtkMatrix | ( | ) |
Definition at line 690 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::GetVtkMatrix().
Referenced by ExecuteOperation(), mitk::PlaneGeometry::ExecuteOperation(), and mitk::ImageToIGTLMessageFilter::GenerateData().
vtkLinearTransform * mitk::BaseGeometry::GetVtkTransform | ( | ) | const |
Get the m_IndexToWorldTransform as a vtkLinearTransform.
Definition at line 476 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::GetVtkTransform().
Referenced by mitk::PlaneClipping::CalculateClippedPlaneBounds(), mitk::ExtractDirectedPlaneImageFilter::CalculateClippedPlaneBounds(), mitk::LabeledImageToSurfaceFilter::CreateSurface(), mitk::ImageToSurfaceFilter::CreateSurface(), mitk::PointSetVtkMapper2D::CreateVTKRenderObjects(), mitk::PlaneGeometryDataToSurfaceFilter::GenerateOutputInformation(), mitk::SurfaceVtkIO::GetPolyData(), mitk::LabelSetImageToSurfaceFilter::InternalProcessing(), mitk::Cylinder::IsInside(), mitk::Cuboid::IsInside(), mitk::Cone::IsInside(), mitk::Ellipsoid::IsInside(), and mitk::SurfaceToImageFilter::Stencil3DImage().
|
virtual |
|
virtual |
void mitk::BaseGeometry::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.
Definition at line 516 of file mitkBaseGeometry.cpp.
References GetIndexToWorldTransform().
Referenced by mitk::LabeledImageVolumeCalculator::_InternalCalculateVolumes(), QmitkSlicesInterpolator::AcceptAllInterpolations(), mitk::ContourModelUtils::BackProjectContourFrom2DSlice(), mitk::LabelSetImage::CalculateCenterOfMassProcessing(), ComputeIntensityProfile(), mitk::PlaneGeometryDataMapper2D::CutCrossLineWithReferenceGeometry(), mitk::BoundingShapeCropper::CutImage(), mitk::ImageToUnstructuredGridFilter::ExtractPoints(), mitk::Generate3DDeformationGlyph(), mitk::Generate3DDeformationGrid(), mitk::ImageToPointCloudFilter::GenerateData(), mitk::ImageToContourFilter::GenerateData(), mitk::BoundingShapeCropper::GenerateData(), mitk::BoundingObjectCutter::GenerateOutputInformation(), GetCenter(), mitk::PointSet::GetPoint(), mitk::PointSet::GetPointIfExists(), IndexToWorld(), mitk::LabelSetImageToSurfaceFilter::InternalProcessing(), mitk::ImageToContourModelFilter::Itk2DContourExtraction(), mitk::OverwriteDirectedPlaneImageFilter::ItkSliceOverwriting(), mitk::SlicedGeometry3D::PreSetSpacing(), testIndexAndWorldConsistency(), testIndexAndWorldConsistencyForIndex(), testIndexAndWorldConsistencyForVectors(), and mitk::ClippingPlaneInteractor3D::TranslateObject().
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 511 of file mitkBaseGeometry.cpp.
References GetIndexToWorldTransform().
|
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 300 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)
Definition at line 680 of file mitkBaseGeometry.cpp.
References IndexToWorld(), and MITK_WARN.
void mitk::BaseGeometry::Initialize | ( | ) |
Initialize the BaseGeometry.
Definition at line 88 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::Initialize(), and SetFloatBounds().
Referenced by mitk::AbstractTransformGeometry::AbstractTransformGeometry(), BaseGeometry(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::SlicedGeometry3D::InitializeSlicedGeometry(), mitk::PlaneGeometry::InitializeStandardPlane(), and mitk::PlaneGeometry::PlaneGeometry().
void mitk::BaseGeometry::InitializeGeometry | ( | Self * | newGeometry | ) | const |
Initialize the geometry
Definition at line 121 of file mitkBaseGeometry.cpp.
References GetFrameOfReferenceID(), GetGeometryTransformHolder(), mitk::GeometryTransformHolder::Initialize(), SetBounds(), and SetFrameOfReferenceID().
Referenced by BaseGeometry().
|
overrideprotectedpure virtual |
clones the geometry
Overwrite in all sub-classes. Normally looks like:
Implemented in mitk::PlaneGeometry, mitk::SlicedGeometry3D, mitk::AbstractTransformGeometry, mitk::Geometry3D, mitk::LandmarkProjectorBasedCurvedGeometry, and mitk::ThinPlateSplineCurvedGeometry.
|
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 234 of file mitkBaseGeometry.cpp.
References GetIndexToWorldTransform(), GetOrigin(), and GetSpacing().
|
protected |
Definition at line 695 of file mitkBaseGeometry.cpp.
Referenced by mitk::SlicedGeometry3D::GetBoundingBox(), GetCornerPoint(), mitk::PlaneGeometry::Map(), PrintSelf(), mitk::AbstractTransformGeometry::Project(), 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 392 of file mitkBaseGeometry.cpp.
References GetBoundingBox().
Referenced by mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), IsInside(), mitk::OverwriteDirectedPlaneImageFilter::ItkSliceOverwriting(), mitk::SetRegionTool::OnMousePressed(), and QmitkAdaptiveRegionGrowingToolGUI::OnPointAdded().
|
inline |
Convenience method for working with ITK indices.
Definition at line 494 of file mitkBaseGeometry.h.
|
protected |
Definition at line 700 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::IsIndexToWorldTransformNull().
Referenced by PrintSelf().
bool mitk::BaseGeometry::IsInside | ( | const mitk::Point3D & | p | ) | const |
Test whether the point p (world coordinates in mm) is inside the bounding box.
Definition at line 385 of file mitkBaseGeometry.cpp.
References IsIndexInside(), and WorldToIndex().
Referenced by mitk::LiveWireTool2D::ClearSegmentation(), mitk::PlanarFigureMaskGenerator::GetReferenceImage(), QmitkAdaptiveRegionGrowingToolGUI::OnPointAdded(), QmitkAdaptiveRegionGrowingToolGUI::RunSegmentation(), and mitk::PlaneGeometryDataMapper2D::TestPointInReferenceGeometry().
|
virtual |
Is this BaseGeometry in a state that is valid?
This function returns always true in the BaseGeometry class. Other implementations are possible in subclasses.
Reimplemented in mitk::ThinPlateSplineCurvedGeometry.
Definition at line 201 of file mitkBaseGeometry.cpp.
Referenced by mitk::SurfaceVtkMapper2D::GenerateDataForRenderer(), mitk::RegEvaluationMapper2D::GenerateDataForRenderer(), mitk::DoseImageVtkMapper2D::GenerateDataForRenderer(), mitk::ImageVtkMapper2D::GenerateDataForRenderer(), mitk::BoundingShapeVtkMapper2D::SetDefaultProperties(), mitk::AbstractTransformGeometry::SetFrameGeometry(), and mitk::VtkPropRenderer::Update().
|
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 340 of file mitkBaseGeometry.h.
References mitk::vtk2itk().
|
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 798 of file mitkBaseGeometry.cpp.
Referenced by Compose(), mitk::SlicedGeometry3D::ExecuteOperation(), ExecuteOperation(), mitk::PlaneGeometry::ExecuteOperation(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::SlicedGeometry3D::PreSetSpacing(), mitk::SlicedGeometry3D::ReinitializePlanes(), SetBounds(), mitk::SlicedGeometry3D::SetDirectionVector(), mitk::SlicedGeometry3D::SetEvenlySpaced(), SetExtentInMM(), SetIdentity(), SetIndexToWorldTransform(), SetIndexToWorldTransformWithoutChangingSpacing(), mitk::LandmarkProjectorBasedCurvedGeometry::SetLandmarkProjector(), SetOrigin(), mitk::AbstractTransformGeometry::SetParametricBounds(), mitk::AbstractTransformGeometry::SetPlane(), and mitk::ModifiedLock::~ModifiedLock().
|
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 575 of file mitkBaseGeometry.h.
Referenced by SetSpacing().
|
overrideprotected |
Definition at line 735 of file mitkBaseGeometry.cpp.
References GetBoundingBox(), GetImageGeometry(), GetIndexToWorldTransform(), GetOrigin(), GetSpacing(), IsBoundingBoxNull(), and IsIndexToWorldTransformNull().
Referenced by mitk::SlicedGeometry3D::PrintSelf(), and mitk::PlaneGeometry::PrintSelf().
void mitk::BaseGeometry::SetBounds | ( | const BoundsArrayType & | bounds | ) |
Set the bounding box (in index/unit coordinates)
Only possible via the BoundsArray to make clear that a copy of the bounding-box is stored, not a reference to it.
Set the bounds
Definition at line 138 of file mitkBaseGeometry.cpp.
References CheckBounds(), and Modified().
Referenced by mitk::BoundingObject::BoundingObject(), mitk::AbstractTransformGeometry::CalculateFrameGeometry(), mitk::PlaneGeometry::ExecuteOperation(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), InitializeGeometry(), mitk::PlaneGeometry::InitializeStandardPlane(), SetFloatBounds(), mitk::AbstractTransformGeometry::SetFrameGeometry(), mitk::PlaneGeometry::SetSizeInUnits(), mitk::BoundingObjectGroup::UpdateOutputInformation(), mitk::ContourSet::UpdateOutputInformation(), mitk::ContourModelSet::UpdateOutputInformation(), mitk::Contour::UpdateOutputInformation(), mitk::PointSet::UpdateOutputInformation(), mitk::ContourModel::UpdateOutputInformation(), and mitk::Gizmo::UpdateRepresentation().
void mitk::BaseGeometry::SetExtentInMM | ( | int | direction, |
ScalarType | extentInMM | ||
) |
Set the extent of the bounding-box in the specified direction in mm.
Definition at line 364 of file mitkBaseGeometry.cpp.
References mitk::eps, GetExtentInMM(), mitk::GeometryTransformHolder::GetVnlMatrix(), Modified(), and mitk::GeometryTransformHolder::SetMatrix().
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 100 of file mitkBaseGeometry.cpp.
References SetBounds().
Referenced by Initialize().
void mitk::BaseGeometry::SetFloatBounds | ( | const double | bounds[6] | ) |
Set the bounding box (in index/unit coordinates) via a double array.
Definition at line 110 of file mitkBaseGeometry.cpp.
References SetBounds().
|
virtual |
Set the DICOM FrameOfReferenceID referring to the used world coordinate system.
Referenced by mitk::SlicedGeometry3D::InitializeEvenlySpaced(), and InitializeGeometry().
void mitk::BaseGeometry::SetIdentity | ( | ) |
Set the transform to identity, the spacing to 1 and origin to 0.
Definition at line 481 of file mitkBaseGeometry.cpp.
References Modified(), and mitk::GeometryTransformHolder::SetIdentity().
Referenced by mitk::BoundingObject::FitGeometry().
|
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 ChangeImageGeometryConsideringOriginOffset(), and mitk::SlicedGeometry3D::SetImageGeometry().
void mitk::BaseGeometry::SetIndexToWorldTransform | ( | mitk::AffineTransform3D * | transform | ) |
Definition at line 165 of file mitkBaseGeometry.cpp.
References CheckIndexToWorldTransform(), Modified(), and mitk::GeometryTransformHolder::SetIndexToWorldTransform().
Referenced by mitk::PlaneGeometry::ExecuteOperation(), mitk::USCombinedModality::GenerateData(), mitk::BoundingShapeCropper::GenerateData(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::PlaneGeometryDataToSurfaceFilter::GenerateOutputInformation(), mitk::BoundingObjectCutter::GenerateOutputInformation(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::AbstractTransformGeometry::SetFrameGeometry(), mitk::PlaneGeometry::SetMatrixByVectors(), mitk::BoundingObjectGroup::UpdateOutputInformation(), and mitk::ContourSet::UpdateOutputInformation().
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.
Definition at line 670 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::SetIndexToWorldTransformByVtkMatrix().
void mitk::BaseGeometry::SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing | ( | vtkMatrix4x4 * | vtkmatrix | ) |
Convenience method for setting the ITK transform (m_IndexToWorldTransform) via an vtkMatrix4x4. This function keeps the original spacing.
Definition at line 675 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing().
void mitk::BaseGeometry::SetIndexToWorldTransformWithoutChangingSpacing | ( | mitk::AffineTransform3D * | transform | ) |
Definition at line 175 of file mitkBaseGeometry.cpp.
References CheckIndexToWorldTransform(), mitk::Equal(), GetSpacing(), MITK_WARN, Modified(), and mitk::GeometryTransformHolder::SetIndexToWorldTransformWithoutChangingSpacing().
void mitk::BaseGeometry::SetOrigin | ( | const Point3D & | origin | ) |
Set the origin, i.e. the upper-left corner of the plane.
Definition at line 72 of file mitkBaseGeometry.cpp.
References GetOrigin(), Modified(), and mitk::GeometryTransformHolder::SetOrigin().
Referenced by ChangeImageGeometryConsideringOriginOffset(), mitk::BoundingObject::FitGeometry(), mitk::ItkImageFileReader::GenerateData(), mitk::BoundingShapeCropper::GenerateData(), mitk::BoundingObjectCutter::GenerateOutputInformation(), mitk::AutoCropImageFilter::GenerateOutputInformation(), mitk::Image::Initialize(), mitk::Image::InitializeByItk(), mitk::PlaneGeometry::InitializePlane(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::LabelSetImageToSurfaceFilter::InternalProcessing(), mitk::ItkImageIO::Read(), mitk::LabelSetImageIO::Read(), mitk::SlicedGeometry3D::ReinitializePlanes(), mitk::SlicedData::SetOrigin(), Translate(), and mitk::ClippingPlaneInteractor3D::TranslateObject().
void mitk::BaseGeometry::SetSpacing | ( | const mitk::Vector3D & | aSpacing, |
bool | enforceSetSpacing = false |
||
) |
Set the spacing (m_Spacing).
The spacing is also changed in the IndexToWorldTransform.
Definition at line 206 of file mitkBaseGeometry.cpp.
References _SetSpacing(), and PreSetSpacing().
Referenced by mitk::SlicedGeometry3D::ExecuteOperation(), mitk::BoundingObject::FitGeometry(), mitk::DicomSeriesReader::FixSpacingInformation(), mitk::ItkImageFileReader::GenerateData(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::DICOMImageBlockDescriptor::GetMitkImage(), mitk::Image::Initialize(), mitk::Image::InitializeByItk(), mitk::SlicedGeometry3D::InitializeEvenlySpaced(), mitk::SlicedGeometry3D::InitializeSlicedGeometry(), mitk::ItkImageIO::Read(), mitk::LabelSetImageIO::Read(), mitk::SlicedGeometry3D::ReinitializePlanes(), mitk::SlicedData::SetSpacing(), and mitk::SlicedGeometry3D::SlicedGeometry3D().
|
protected |
Definition at line 62 of file mitkBaseGeometry.cpp.
References mitk::GeometryTransformHolder::SetVtkMatrixDeepCopy().
Referenced by ExecuteOperation(), and mitk::PlaneGeometry::ExecuteOperation().
void mitk::BaseGeometry::Translate | ( | const Vector3D & | vector | ) |
Translate the origin by a vector.
Definition at line 503 of file mitkBaseGeometry.cpp.
References GetOrigin(), and SetOrigin().
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.
Definition at line 420 of file mitkBaseGeometry.cpp.
References GetIndexToWorldTransform(), and offset.
Referenced by QmitkSlicesInterpolator::AcceptAllInterpolations(), AddPointToPath(), mitk::AffineImageCropperInteractor::CheckOverObject(), mitk::PlanarFigureMaskGenerator::CheckPlanarFigureIsNotTilted(), ComputeIntensityProfile(), mitk::PlaneGeometryDataMapper2D::CutCrossLineWithReferenceGeometry(), mitk::SegTool2D::DetermineAffectedImageSlice(), mitk::PointSet::ExecuteOperation(), mitk::ContourModelSetToImageFilter::GenerateData(), mitk::ExtractDirectedPlaneImageFilterNew::GenerateOutputInformation(), mitk::ImagePixelWriteAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates(), mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates(), mitk::Image::GetPixelValueByWorldCoordinate(), mitk::PlanarFigureMaskGenerator::GetReferenceImage(), mitk::PointSet::InsertPoint(), mitk::PlaneGeometry::IsAbove(), IsInside(), mitk::OverwriteDirectedPlaneImageFilter::ItkSliceOverwriting(), mitk::PlaneGeometry::Map(), mitk::SetRegionTool::OnMousePressed(), QmitkAdaptiveRegionGrowingToolGUI::OnPointAdded(), mitk::SlicedGeometry3D::PreSetSpacing(), mitk::PlaneGeometry::Project(), QmitkAdaptiveRegionGrowingToolGUI::RunSegmentation(), mitk::PointSet::SearchPoint(), mitk::PointSet::SetPoint(), mitk::PickingTool::StartRegionGrowing(), testIndexAndWorldConsistency(), testIndexAndWorldConsistencyForIndex(), testIndexAndWorldConsistencyForVectors(), and WorldToIndex().
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 431 of file mitkBaseGeometry.cpp.
References GetIndexToWorldTransform().
|
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 268 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.
Definition at line 462 of file mitkBaseGeometry.cpp.
References MITK_WARN, and WorldToIndex().
|
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 362 of file mitkBaseGeometry.h.
References mitk::vtk2itk().