17 #ifndef BaseGeometry_H_HEADER_INCLUDED
18 #define BaseGeometry_H_HEADER_INCLUDED
24 #include "itkScalableAffineTransform.h"
26 #include <itkAffineGeometryFrame.h>
27 #include <itkBoundingBox.h>
29 #include <itkQuaternionRigidTransform.h>
33 #include <vtkTransform.h>
36 class vtkMatrixToLinearTransform;
37 class vtkLinearTransform;
45 typedef itk::BoundingBox<unsigned long, 3, ScalarType>
BoundingBox;
118 const
Point3D GetOrigin() const;
123 void SetOrigin(const
Point3D &origin);
134 void SetSpacing(const
mitk::
Vector3D &aSpacing,
bool enforceSetSpacing = false);
147 itkGetConstMacro(FrameOfReferenceID,
unsigned int);
151 itkSetMacro(FrameOfReferenceID,
unsigned int);
153 itkGetConstMacro(IndexToWorldTransformLastModified,
unsigned long);
159 void Modified() const override;
167 virtual
bool IsValid() const;
175 void InitializeGeometry(
Self *newGeometry) const;
199 void SetIndexToWorldTransformByVtkMatrix(vtkMatrix4x4 *vtkmatrix);
209 void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkMatrix4x4 *vtkmatrix);
212 vtkMatrix4x4 *GetVtkMatrix();
216 vtkLinearTransform *GetVtkTransform() const;
237 void Compose(const TransformType *other,
bool pre = 0);
243 void Compose(const vtkMatrix4x4 *vtkmatrix,
bool pre = 0);
248 void Translate(const
Vector3D &vector);
252 virtual
void ExecuteOperation(
Operation *operation) override;
271 template <
unsigned int VIndexDimension>
272 void WorldToIndex(const
mitk::
Point3D &pt_mm,
itk::Index<VIndexDimension> &index)
const
276 this->WorldToIndex(pt_mm, pt_units);
277 int i, dim = index.GetIndexDimension();
283 for (i = 0; i < dim; ++i)
285 index[i] = itk::Math::RoundHalfIntegerUp<typename IndexType::IndexValueType>(pt_units[i]);
303 template <
unsigned int VIndexDimension>
308 int i, dim = index.GetIndexDimension();
313 for (i = 0; i < dim; ++i)
315 pt_units[i] = index[i];
318 IndexToWorld(pt_units, pt_mm);
343 template <
class TCoordRep>
365 template <
class TCoordRep>
396 void SetFloatBounds(
const float bounds[6]);
399 void SetFloatBounds(
const double bounds[6]);
406 VnlVector GetMatrixColumn(
unsigned int direction)
const;
425 ScalarType GetExtent(
unsigned int direction)
const;
429 ScalarType GetExtent(
unsigned int direction)
const;
435 ScalarType GetExtentInMM(
int direction)
const;
443 Vector3D GetAxisVector(
unsigned int direction)
const;
450 virtual bool Is2DConvertable();
460 double GetDiagonalLength2()
const;
465 double GetDiagonalLength()
const;
471 Point3D GetCornerPoint(
int id)
const;
477 Point3D GetCornerPoint(
bool xFront =
true,
bool yFront =
true,
bool zFront =
true)
const;
483 void SetExtentInMM(
int direction,
ScalarType extentInMM);
497 template <
unsigned int VIndexDimension>
500 int i, dim = index.GetIndexDimension();
503 for (i = 0; i < dim; ++i)
505 pt_index[i] = index[i];
507 return IsIndexInside(pt_index);
516 virtual void ChangeImageGeometryConsideringOriginOffset(
const bool isAnImageGeometry);
522 itkGetConstMacro(ImageGeometry,
bool)
536 itkSetMacro(ImageGeometry,
bool) itkBooleanMacro(ImageGeometry)
543 BaseGeometry(const BaseGeometry &other);
544 virtual ~BaseGeometry();
556 virtual
itk::LightObject::
Pointer InternalClone() const override = 0;
558 virtual
void PrintSelf(
std::ostream &os,
itk::Indent indent) const override;
560 static const
std::
string GetTransformAsString(TransformType *transformType);
562 itkGetConstMacro(NDimensions,
unsigned int)
564 bool IsBoundingBoxNull() const;
566 bool IsIndexToWorldTransformNull() const;
568 void SetVtkMatrixDeepCopy(vtkTransform *vtktransform);
570 void _SetSpacing(const
mitk::
Vector3D &aSpacing,
bool enforceSetSpacing = false);
601 void InitializeGeometryTransformHolder(
const BaseGeometry *otherGeometry);
608 unsigned int m_FrameOfReferenceID;
612 static const unsigned int m_NDimensions = 3;
616 mutable unsigned long m_IndexToWorldTransformLastModified;
618 bool m_ImageGeometry;
625 bool m_ModifiedLockFlag;
632 mutable bool m_ModifiedCalledFlag;
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBoxType
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
itk::AffineGeometryFrame< ScalarType, 3 > AffineGeometryFrame3D
itk::SmartPointer< Self > Pointer
BoundingBoxType::BoundsArrayType BoundsArrayType
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Base class of all Operation-classes.
vnl_vector< ScalarType > VnlVector
GeometryTransformHolder::TransformType TransformType
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 ...
ModifiedLock manages the calls of Modified() functions.
DataCollection - Class to facilitate loading/accessing structured data.
virtual void CheckIndexToWorldTransform(mitk::AffineTransform3D *)
CheckIndexToWorldTransform.
abstract class, that can be used by Undo to undo an operation.
bool IsIndexInside(const itk::Index< VIndexDimension > &index) const
Convenience method for working with ITK indices.
virtual void CheckBounds(const BoundsArrayType &)
CheckBounds.
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...
#define mitkClassMacroItkParent(className, SuperClassName)
itk::BoundingBox< unsigned long, 3, mitk::ScalarType > BoundingBoxType
void vtk2itk(const Tin &in, Tout &out)
itk::AffineGeometryFrame< ScalarType, 3 >::TransformType AffineTransform3D
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 IT...
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
MITKCORE_EXPORT const ScalarType eps
BoundingBoxType::Pointer BoundingBoxPointer
itk::FixedArray< ScalarType, 3 > FixedArrayType
BoundingBoxType::Pointer BoundingBoxPointer
BaseGeometry Describes the geometry of a data object.
BoundingBoxType::BoundsArrayType BoundsArrayType