Medical Imaging Interaction Toolkit  2018.4.99-b585543d
Medical Imaging Interaction Toolkit
mitk::SlicedGeometry3D Class Reference

Describes the geometry of a data object consisting of slices. More...

#include <mitkSlicedGeometry3D.h>

Inheritance diagram for mitk::SlicedGeometry3D:
Collaboration diagram for mitk::SlicedGeometry3D:

Public Types

typedef SlicedGeometry3D Self
 
typedef BaseGeometry Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::BaseGeometry
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 override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual mitk::PlaneGeometryGetPlaneGeometry (int s) const
 Returns the PlaneGeometry of the slice (s). More...
 
const PlaneGeometryGetGeometry2D (int s)
 
void SetGeometry2D (PlaneGeometry *geo, int s)
 
void ChangeImageGeometryConsideringOriginOffset (const bool isAnImageGeometry) override
 When switching from an Image Geometry to a normal Geometry (and the other way around), you have to. More...
 
const mitk::BoundingBoxGetBoundingBox () const override
 
virtual unsigned int GetSlices () const
 Get the number of slices. More...
 
virtual bool SetPlaneGeometry (mitk::PlaneGeometry *geometry2D, int s)
 Set PlaneGeometry of slice s. More...
 
virtual bool IsValidSlice (int s=0) const
 Check whether a slice exists. More...
 
virtual const BaseGeometryGetReferenceGeometry () const
 
virtual void SetReferenceGeometry (const BaseGeometry *referenceGeometry)
 
bool HasReferenceGeometry () const
 
virtual void SetSliceNavigationController (mitk::SliceNavigationController *snc)
 Set the SliceNavigationController corresponding to this sliced geometry. More...
 
mitk::SliceNavigationControllerGetSliceNavigationController ()
 
virtual bool GetEvenlySpaced () const
 Set/Get whether the SlicedGeometry3D is evenly-spaced (m_EvenlySpaced) More...
 
virtual void SetEvenlySpaced (bool on=true)
 
virtual void SetDirectionVector (const mitk::Vector3D &directionVector)
 Set/Get the vector between slices for the evenly-spaced case (m_EvenlySpaced==true). More...
 
virtual const mitk::Vector3DGetDirectionVector () const
 
itk::LightObject::Pointer InternalClone () const override
 clones the geometry More...
 
virtual void InitializeSlicedGeometry (unsigned int slices)
 Tell this instance how many PlaneGeometries it shall manage. Bounding box and the PlaneGeometries must be set additionally by calling the respective methods! More...
 
virtual void InitializeEvenlySpaced (mitk::PlaneGeometry *geometry2D, unsigned int slices)
 Completely initialize this instance as evenly-spaced with slices parallel to the provided PlaneGeometry that is used as the first slice and for spacing calculation. More...
 
virtual void InitializeEvenlySpaced (mitk::PlaneGeometry *geometry2D, mitk::ScalarType zSpacing, unsigned int slices)
 Completely initialize this instance as evenly-spaced with slices parallel to the provided PlaneGeometry that is used as the first slice and for spacing calculation (except z-spacing). More...
 
virtual void InitializePlanes (const mitk::BaseGeometry *geometry3D, mitk::PlaneGeometry::PlaneOrientation planeorientation, bool top=true, bool frontside=true, bool rotated=false)
 Completely initialize this instance as evenly-spaced plane slices parallel to a side of the provided BaseGeometry and using its spacing information. More...
 
void SetImageGeometry (const bool isAnImageGeometry) override
 Define that this BaseGeometry is refering to an Image. More...
 
void ExecuteOperation (Operation *operation) override
 executes affine operations (translate, rotate, scale) More...
 
- Public Member Functions inherited from mitk::BaseGeometry
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=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 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 bool GetImageGeometry () const
 Is this an ImageGeometry? 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 ()
 
static Pointer New ()
 
static double CalculateSpacing (const mitk::Vector3D &spacing, const mitk::Vector3D &d)
 
- Static Public Member Functions inherited from mitk::BaseGeometry
static const char * GetStaticNameOfClass ()
 

Static Public Attributes

static const std::string SLICES
 
static const std::string DIRECTION_VECTOR
 
static const std::string EVENLY_SPACED
 

Protected Member Functions

 SlicedGeometry3D ()
 
 SlicedGeometry3D (const SlicedGeometry3D &other)
 
 ~SlicedGeometry3D () override
 
virtual void ReinitializePlanes (const Point3D &center, const Point3D &referencePoint)
 
ScalarType GetLargestExtent (const BaseGeometry *geometry)
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
double CalculateSpacing (const mitk::Vector3D &direction) const
 
mitk::Vector3D AdjustNormal (const mitk::Vector3D &normal) const
 
void PreSetSpacing (const mitk::Vector3D &aSpacing) override
 PreSetSpacing. More...
 
- Protected Member Functions inherited from mitk::BaseGeometry
 BaseGeometry ()
 
 BaseGeometry (const BaseGeometry &other)
 
 ~BaseGeometry () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual unsigned int GetNDimensions () const
 
bool IsBoundingBoxNull () const
 
bool IsIndexToWorldTransformNull () const
 
void SetVtkMatrixDeepCopy (vtkTransform *vtktransform)
 
void _SetSpacing (const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
 
virtual void CheckBounds (const BoundsArrayType &)
 CheckBounds. More...
 
virtual void CheckIndexToWorldTransform (mitk::AffineTransform3D *)
 CheckIndexToWorldTransform. More...
 

Protected Attributes

std::vector< PlaneGeometry::Pointerm_PlaneGeometries
 
bool m_EvenlySpaced
 
mitk::Vector3D m_DirectionVector
 
unsigned int m_Slices
 
const mitk::BaseGeometrym_ReferenceGeometry
 
mitk::SliceNavigationControllerm_SliceNavigationController
 

Additional Inherited Members

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

Detailed Description

Describes the geometry of a data object consisting of slices.

A PlaneGeometry can be requested for each slice. In the case of evenly-spaced, plane geometries (m_EvenlySpaced==true), only the 2D-geometry of the first slice has to be set (to an instance of PlaneGeometry). The 2D geometries of the other slices are calculated by shifting the first slice in the direction m_DirectionVector by m_Spacing.z * sliceNumber. The m_Spacing member (which is only relevant in the case m_EvenlySpaced==true) descibes the size of a voxel (in mm), i.e., m_Spacing.x is the voxel width in the x-direction of the plane. It is derived from the reference geometry of this SlicedGeometry3D, which usually would be the global geometry describing how datasets are to be resliced.

By default, slices are oriented in the direction of one of the main axes (x, y, z). However, by means of rotation, it is possible to realign the slices in any possible direction. In case of an inclined plane, the spacing is derived as a product of the (regular) geometry spacing and the direction vector of the plane.

SlicedGeometry3D and the associated PlaneGeometries 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

See also
itk::ProcessObject::GenerateOutputInformation(),
itk::DataObject::CopyInformation() and itk::DataObject::UpdateOutputInformation().

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

Warning
The hull (i.e., transform, bounding-box and time-bounds) is only guaranteed to be up-to-date after calling UpdateInformation().

Definition at line 62 of file mitkSlicedGeometry3D.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

◆ Superclass

Constructor & Destructor Documentation

◆ SlicedGeometry3D() [1/2]

mitk::SlicedGeometry3D::SlicedGeometry3D ( )
protected

Definition at line 27 of file mitkSlicedGeometry3D.cpp.

References InitializeSlicedGeometry(), m_DirectionVector, and m_Slices.

Referenced by InternalClone().

◆ SlicedGeometry3D() [2/2]

◆ ~SlicedGeometry3D()

mitk::SlicedGeometry3D::~SlicedGeometry3D ( )
overrideprotected

Definition at line 72 of file mitkSlicedGeometry3D.cpp.

Member Function Documentation

◆ AdjustNormal()

mitk::Vector3D mitk::SlicedGeometry3D::AdjustNormal ( const mitk::Vector3D normal) const
protected

The extent of the slice stack, i.e. the number of slices, depends on the plane normal. For rotated geometries, the geometry's transform needs to be accounted in this calculation.

Definition at line 412 of file mitkSlicedGeometry3D.cpp.

References mitk::BaseGeometry::GetIndexToWorldTransform(), and m_ReferenceGeometry.

◆ CalculateSpacing() [1/2]

double mitk::SlicedGeometry3D::CalculateSpacing ( const mitk::Vector3D spacing,
const mitk::Vector3D d 
)
static

◆ CalculateSpacing() [2/2]

double mitk::SlicedGeometry3D::CalculateSpacing ( const mitk::Vector3D direction) const
protected

Calculate "directed spacing", i.e. the spacing in directions non-orthogonal to the coordinate axes. This is done via the ellipsoid equation.

Definition at line 383 of file mitkSlicedGeometry3D.cpp.

References CalculateSpacing(), mitk::BaseGeometry::GetSpacing(), and m_ReferenceGeometry.

◆ ChangeImageGeometryConsideringOriginOffset()

void mitk::SlicedGeometry3D::ChangeImageGeometryConsideringOriginOffset ( const bool  isAnImageGeometry)
overridevirtual

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

Reimplemented from mitk::BaseGeometry.

Definition at line 438 of file mitkSlicedGeometry3D.cpp.

References mitk::BaseGeometry::ChangeImageGeometryConsideringOriginOffset(), m_PlaneGeometries, and m_Slices.

◆ Clone()

Pointer mitk::SlicedGeometry3D::Clone ( ) const

◆ ExecuteOperation()

◆ GetBoundingBox()

const mitk::BoundingBox * mitk::SlicedGeometry3D::GetBoundingBox ( ) const
override

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::SlicedGeometry3D::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::BaseGeometry.

Definition at line 65 of file mitkSlicedGeometry3D.h.

◆ GetClassName()

virtual const char* mitk::SlicedGeometry3D::GetClassName ( ) const
virtual

Reimplemented from mitk::BaseGeometry.

◆ GetDirectionVector()

virtual const mitk::Vector3D& mitk::SlicedGeometry3D::GetDirectionVector ( ) const
virtual

◆ GetEvenlySpaced()

virtual bool mitk::SlicedGeometry3D::GetEvenlySpaced ( ) const
virtual

Set/Get whether the SlicedGeometry3D is evenly-spaced (m_EvenlySpaced)

If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored for the requested slice, and (c) the first slice (s=0) is a PlaneGeometry instance, then we calculate the geometry of the requested as the plane of the first slice shifted by m_Spacing.z * s in the direction of m_DirectionVector.

See also
GetPlaneGeometry

Referenced by mitk::SliceNavigationController::SelectSliceByPoint(), and mitk::SlicedData::SetOrigin().

◆ GetGeometry2D()

const PlaneGeometry* mitk::SlicedGeometry3D::GetGeometry2D ( int  s)
inline
Deprecated:
(as of 2014_10) Please use GetPlaneGeometry

Definition at line 96 of file mitkSlicedGeometry3D.h.

◆ GetLargestExtent()

ScalarType mitk::SlicedGeometry3D::GetLargestExtent ( const BaseGeometry geometry)
protected

◆ GetPlaneGeometry()

mitk::PlaneGeometry * mitk::SlicedGeometry3D::GetPlaneGeometry ( int  s) const
virtual

Returns the PlaneGeometry of the slice (s).

If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored for the requested slice, and (c) the first slice (s=0) is a PlaneGeometry instance, then we calculate the geometry of the requested as the plane of the first slice shifted by m_Spacing[3]*s in the direction of m_DirectionVector.

Warning
The PlaneGeometries are not necessarily up-to-date and not even initialized.

The PlaneGeometries 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

See also
itk::ProcessObject::GenerateOutputInformation(),
itk::DataObject::CopyInformation() and
itk::DataObject::UpdateOutputInformation().

Definition at line 76 of file mitkSlicedGeometry3D.cpp.

References mitk::PlaneGeometry::Clone(), mitk::PlaneGeometry::GetNormal(), mitk::BaseGeometry::GetSpacing(), IsValidSlice(), m_DirectionVector, m_EvenlySpaced, and m_PlaneGeometries.

Referenced by mitk::Image::Initialize(), PrintSelf(), mitk::SliceNavigationController::SelectSliceByPoint(), mitk::SlicedData::SetGeometry(), mitk::SlicedData::SetOrigin(), mitk::BaseRenderer::SetSlice(), mitk::BaseRenderer::SetTimeStep(), mitk::BaseRenderer::SetWorldGeometry3D(), QmitkSliceBasedInterpolatorWidget::TranslateAndInterpolateChangedSlice(), and QmitkSlicesInterpolator::TranslateAndInterpolateChangedSlice().

◆ GetReferenceGeometry()

const mitk::BaseGeometry * mitk::SlicedGeometry3D::GetReferenceGeometry ( ) const
virtual

Definition at line 458 of file mitkSlicedGeometry3D.cpp.

References m_ReferenceGeometry.

◆ GetSliceNavigationController()

mitk::SliceNavigationController * mitk::SlicedGeometry3D::GetSliceNavigationController ( )

Definition at line 560 of file mitkSlicedGeometry3D.cpp.

References m_SliceNavigationController.

◆ GetSlices()

◆ GetStaticNameOfClass()

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

Definition at line 65 of file mitkSlicedGeometry3D.h.

◆ HasReferenceGeometry()

bool mitk::SlicedGeometry3D::HasReferenceGeometry ( ) const

Definition at line 475 of file mitkSlicedGeometry3D.cpp.

References m_ReferenceGeometry.

◆ InitializeEvenlySpaced() [1/2]

void mitk::SlicedGeometry3D::InitializeEvenlySpaced ( mitk::PlaneGeometry geometry2D,
unsigned int  slices 
)
virtual

Completely initialize this instance as evenly-spaced with slices parallel to the provided PlaneGeometry that is used as the first slice and for spacing calculation.

Initializes the bounding box according to the width/height of the PlaneGeometry and slices. The spacing is calculated from the PlaneGeometry.

Definition at line 154 of file mitkSlicedGeometry3D.cpp.

References mitk::BaseGeometry::GetExtent(), and mitk::BaseGeometry::GetExtentInMM().

Referenced by mitk::ItkImageIO::DoRead(), mitk::LabelSetImageIO::DoRead(), mitk::ItkImageFileReader::GenerateData(), mitk::AutoCropImageFilter::GenerateOutputInformation(), mitk::Image::InitializeByItk(), InitializePlanes(), and mitk::SlicedData::SetOrigin().

◆ InitializeEvenlySpaced() [2/2]

void mitk::SlicedGeometry3D::InitializeEvenlySpaced ( mitk::PlaneGeometry geometry2D,
mitk::ScalarType  zSpacing,
unsigned int  slices 
)
virtual

◆ InitializePlanes()

void mitk::SlicedGeometry3D::InitializePlanes ( const mitk::BaseGeometry geometry3D,
mitk::PlaneGeometry::PlaneOrientation  planeorientation,
bool  top = true,
bool  frontside = true,
bool  rotated = false 
)
virtual

Completely initialize this instance as evenly-spaced plane slices parallel to a side of the provided BaseGeometry and using its spacing information.

Initializes the bounding box according to the width/height of the BaseGeometry and the number of slices according to BaseGeometry::GetExtent(2).

Parameters
planeorientationside parallel to which the slices will be oriented
topif true, create plane at top, otherwise at bottom (for PlaneOrientation Axial, for other plane locations respectively)
frontsidedefines the side of the plane (the definition of front/back is somewhat arbitrary)
rotaterotates the plane by 180 degree around its normal (the definition of rotated vs not rotated is somewhat arbitrary)

Although the double value returned by GetExtent() holds a round number, you need to add 0.5 to safely convert it to unsigned it. I have seen a case when the result was less by one without this.

The normal vector of an imaginary plane that points from the world origin (bottom left back corner or the world, with the lowest physical coordinates) towards the inside of the volume, along the renderer axis. Length is the slice thickness.

The normal of the standard plane geometry just created.

The standard plane must be parallel to the 'world plane'. The normal of the standard plane must point against the world plane if and only if 'top' is 'false'. The length of the standard plane normal must be equal to the slice thickness.

The standard plane normal and the z axis vector of the sliced geometry must point in the same direction.

You can use this test is to check the handedness of the coordinate system of the current geometry. In principle, you can use either left- or right-handed coordinate systems, but you normally want it to be consistent, that is the handedness should be the same across the renderers of the same viewer.

Definition at line 217 of file mitkSlicedGeometry3D.cpp.

References mitk::PlaneGeometry::Frontal, mitk::BaseGeometry::GetAxisVector(), mitk::BaseGeometry::GetExtent(), mitk::BaseGeometry::GetIndexToWorldTransform(), mitk::BaseGeometry::GetSpacing(), InitializeEvenlySpaced(), m_ReferenceGeometry, mitk::PlaneGeometry::New(), and mitk::PlaneGeometry::Sagittal.

◆ InitializeSlicedGeometry()

void mitk::SlicedGeometry3D::InitializeSlicedGeometry ( unsigned int  slices)
virtual

Tell this instance how many PlaneGeometries it shall manage. Bounding box and the PlaneGeometries must be set additionally by calling the respective methods!

Warning
Bounding box and the 2D-geometries must be set additionally: use SetBounds(), SetGeometry().

Definition at line 139 of file mitkSlicedGeometry3D.cpp.

References mitk::BaseGeometry::Initialize(), m_DirectionVector, m_PlaneGeometries, m_Slices, and mitk::BaseGeometry::SetSpacing().

Referenced by SlicedGeometry3D().

◆ InternalClone()

itk::LightObject::Pointer mitk::SlicedGeometry3D::InternalClone ( ) const
overridevirtual

clones the geometry

Overwrite in all sub-classes. Normally looks like:

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

Implements mitk::BaseGeometry.

Definition at line 601 of file mitkSlicedGeometry3D.cpp.

References SlicedGeometry3D().

◆ IsValidSlice()

bool mitk::SlicedGeometry3D::IsValidSlice ( int  s = 0) const
virtual

Check whether a slice exists.

Definition at line 453 of file mitkSlicedGeometry3D.cpp.

References m_Slices.

Referenced by GetPlaneGeometry(), and SetPlaneGeometry().

◆ New()

◆ PreSetSpacing()

void mitk::SlicedGeometry3D::PreSetSpacing ( const mitk::Vector3D aSpacing)
overrideprotectedvirtual

◆ PrintSelf()

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

◆ ReinitializePlanes()

void mitk::SlicedGeometry3D::ReinitializePlanes ( const Point3D center,
const Point3D referencePoint 
)
protectedvirtual

Reinitialize plane stack after rotation. More precisely, the first plane of the stack needs to spatially aligned, in two respects:

  1. Re-alignment with respect to the dataset center; this is necessary since the distance from the first plane to the center could otherwise continuously decrease or increase.
  2. Re-alignment with respect to a given reference point; the reference point is a location which the user wants to be exactly touched by one plane of the plane stack. The first plane is minimally shifted to ensure this touching. Usually, the reference point would be the point around which the geometry is rotated.

Definition at line 287 of file mitkSlicedGeometry3D.cpp.

References CalculateSpacing(), mitk::BaseGeometry::GetAxisVector(), mitk::BaseGeometry::GetExtentInMM(), mitk::PlaneGeometry::GetNormal(), mitk::BaseGeometry::GetOrigin(), mitk::BaseController::GetSlice(), m_DirectionVector, m_PlaneGeometries, m_ReferenceGeometry, m_SliceNavigationController, m_Slices, mitk::BaseGeometry::Modified(), mitk::BaseGeometry::SetOrigin(), mitk::BaseGeometry::SetSpacing(), mitk::Stepper::SetSteps(), and mitk::PlaneGeometry::SignedDistanceFromPlane().

Referenced by ExecuteOperation().

◆ SetDirectionVector()

void mitk::SlicedGeometry3D::SetDirectionVector ( const mitk::Vector3D directionVector)
virtual

Set/Get the vector between slices for the evenly-spaced case (m_EvenlySpaced==true).

If the direction-vector is (0,0,0) (the default) and the first 2D geometry is a PlaneGeometry, then the direction-vector will be calculated from the plane normal.

See also
m_DirectionVector

Definition at line 574 of file mitkSlicedGeometry3D.cpp.

References m_DirectionVector, and mitk::BaseGeometry::Modified().

Referenced by InitializeEvenlySpaced(), and SlicedGeometry3D().

◆ SetEvenlySpaced()

void mitk::SlicedGeometry3D::SetEvenlySpaced ( bool  on = true)
virtual

Definition at line 565 of file mitkSlicedGeometry3D.cpp.

References m_EvenlySpaced, and mitk::BaseGeometry::Modified().

Referenced by InitializeEvenlySpaced().

◆ SetGeometry2D()

void mitk::SlicedGeometry3D::SetGeometry2D ( PlaneGeometry geo,
int  s 
)
inline
Deprecated:
(as of 2014_10) Please use SetPlaneGeometry

Definition at line 100 of file mitkSlicedGeometry3D.h.

◆ SetImageGeometry()

void mitk::SlicedGeometry3D::SetImageGeometry ( const bool  _arg)
overridevirtual

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 from mitk::BaseGeometry.

Definition at line 423 of file mitkSlicedGeometry3D.cpp.

References m_PlaneGeometries, m_Slices, and mitk::BaseGeometry::SetImageGeometry().

Referenced by InitializeEvenlySpaced().

◆ SetPlaneGeometry()

bool mitk::SlicedGeometry3D::SetPlaneGeometry ( mitk::PlaneGeometry geometry2D,
int  s 
)
virtual

Set PlaneGeometry of slice s.

Definition at line 128 of file mitkSlicedGeometry3D.cpp.

References IsValidSlice(), m_PlaneGeometries, and m_ReferenceGeometry.

Referenced by InitializeEvenlySpaced(), and SlicedGeometry3D().

◆ SetReferenceGeometry()

void mitk::SlicedGeometry3D::SetReferenceGeometry ( const BaseGeometry referenceGeometry)
virtual

Definition at line 463 of file mitkSlicedGeometry3D.cpp.

References m_PlaneGeometries, and m_ReferenceGeometry.

◆ SetSliceNavigationController()

void mitk::SlicedGeometry3D::SetSliceNavigationController ( mitk::SliceNavigationController snc)
virtual

Set the SliceNavigationController corresponding to this sliced geometry.

The SNC needs to be informed when the number of slices in the geometry changes, which can occur whenthe slices are re-oriented by rotation.

Definition at line 555 of file mitkSlicedGeometry3D.cpp.

References m_SliceNavigationController.

Member Data Documentation

◆ DIRECTION_VECTOR

const std::string mitk::SlicedGeometry3D::DIRECTION_VECTOR
static

Definition at line 176 of file mitkSlicedGeometry3D.h.

◆ EVENLY_SPACED

const std::string mitk::SlicedGeometry3D::EVENLY_SPACED
static

Definition at line 177 of file mitkSlicedGeometry3D.h.

◆ m_DirectionVector

mitk::Vector3D mitk::SlicedGeometry3D::m_DirectionVector
mutableprotected

Vector between slices for the evenly-spaced case (m_EvenlySpaced==true). If the direction-vector is (0,0,0) (the default) and the first 2D geometry is a PlaneGeometry, then the direction-vector will be calculated from the plane normal.

Definition at line 304 of file mitkSlicedGeometry3D.h.

Referenced by ExecuteOperation(), GetPlaneGeometry(), InitializeSlicedGeometry(), PrintSelf(), ReinitializePlanes(), SetDirectionVector(), and SlicedGeometry3D().

◆ m_EvenlySpaced

bool mitk::SlicedGeometry3D::m_EvenlySpaced
protected

If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored for the requested slice, and (c) the first slice (s=0) is a PlaneGeometry instance, then we calculate the geometry of the requested as the plane of the first slice shifted by m_Spacing.z*s in the direction of m_DirectionVector.

See also
GetPlaneGeometry

Definition at line 296 of file mitkSlicedGeometry3D.h.

Referenced by ExecuteOperation(), GetPlaneGeometry(), PreSetSpacing(), PrintSelf(), SetEvenlySpaced(), and SlicedGeometry3D().

◆ m_PlaneGeometries

std::vector<PlaneGeometry::Pointer> mitk::SlicedGeometry3D::m_PlaneGeometries
mutableprotected

◆ m_ReferenceGeometry

const mitk::BaseGeometry* mitk::SlicedGeometry3D::m_ReferenceGeometry
protected

◆ m_SliceNavigationController

mitk::SliceNavigationController* mitk::SlicedGeometry3D::m_SliceNavigationController
protected

SNC correcsponding to this geometry; used to reflect changes in the number of slices due to rotation.

Definition at line 315 of file mitkSlicedGeometry3D.h.

Referenced by ExecuteOperation(), GetSliceNavigationController(), ReinitializePlanes(), and SetSliceNavigationController().

◆ m_Slices

unsigned int mitk::SlicedGeometry3D::m_Slices
protected

◆ SLICES

const std::string mitk::SlicedGeometry3D::SLICES
static

Definition at line 175 of file mitkSlicedGeometry3D.h.


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