20 #include <vtkMatrix4x4.h>
21 #include <vtkMatrixToLinearTransform.h>
38 m_FrameOfReferenceID(0),
39 m_IndexToWorldTransformLastModified(0),
40 m_ImageGeometry(false),
41 m_ModifiedLockFlag(false),
42 m_ModifiedCalledFlag(false)
51 m_FrameOfReferenceID(other.m_FrameOfReferenceID),
52 m_IndexToWorldTransformLastModified(other.m_IndexToWorldTransformLastModified),
53 m_ImageGeometry(other.m_ImageGeometry),
54 m_ModifiedLockFlag(false),
55 m_ModifiedCalledFlag(false)
63 delete m_GeometryTransform;
68 m_GeometryTransform->SetVtkMatrixDeepCopy(vtktransform);
73 return m_GeometryTransform->GetOrigin();
80 if (origin != GetOrigin())
82 m_GeometryTransform->SetOrigin(origin);
89 return m_GeometryTransform->GetSpacing();
94 float b[6] = {0, 1, 0, 1, 0, 1};
97 m_GeometryTransform->Initialize();
99 m_FrameOfReferenceID = 0;
101 m_ImageGeometry =
false;
107 const float *input = bounds;
109 for (mitk::BoundingBox::BoundsArrayType::Iterator it = b.Begin(); i < 6; ++i)
117 const double *input = bounds;
119 for (mitk::BoundingBox::BoundsArrayType::Iterator it = b.Begin(); i < 6; ++i)
127 newGeometry->
SetBounds(m_BoundingBox->GetBounds());
131 newGeometry->InitializeGeometryTransformHolder(
this);
133 newGeometry->m_ImageGeometry = m_ImageGeometry;
136 void mitk::BaseGeometry::InitializeGeometryTransformHolder(
const BaseGeometry *otherGeometry)
146 this->CheckBounds(bounds);
152 BoundingBoxType::PointIdentifier pointid;
154 for (pointid = 0; pointid < 2; ++pointid)
157 for (i = 0; i < m_NDimensions; ++i)
159 p[i] = bounds[2 * i + pointid];
161 pointscontainer->InsertElement(pointid, p);
164 m_BoundingBox->SetPoints(pointscontainer);
165 m_BoundingBox->ComputeBoundingBox();
173 CheckIndexToWorldTransform(transform);
175 m_GeometryTransform->SetIndexToWorldTransform(transform);
186 CheckIndexToWorldTransform(transform);
188 m_GeometryTransform->SetIndexToWorldTransformWithoutChangingSpacing(transform);
192 if (!
mitk::Equal(originalSpacing, this->GetSpacing()))
194 MITK_WARN <<
"Spacing has changed in a method, where the spacing must not change.";
201 assert(m_BoundingBox.IsNotNull());
202 return m_BoundingBox->GetBounds();
212 PreSetSpacing(aSpacing);
213 _SetSpacing(aSpacing, enforceSetSpacing);
218 m_GeometryTransform->SetSpacing(aSpacing, enforceSetSpacing);
224 frontToBack.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(direction));
225 frontToBack *= GetExtent(direction);
231 assert(m_BoundingBox.IsNotNull());
232 if (direction >= m_NDimensions)
233 mitkThrow() <<
"Direction is too big. This geometry is for 3D Data";
235 return bounds[direction * 2 + 1] - bounds[direction * 2];
240 bool isConvertableWithoutLoss =
true;
243 if (this->GetSpacing()[2] != 1)
245 isConvertableWithoutLoss =
false;
248 if (this->GetOrigin()[2] != 0)
250 isConvertableWithoutLoss =
false;
254 col0.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(0));
255 col1.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(1));
256 col2.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(2));
258 if ((col0[2] != 0) || (col1[2] != 0) || (col2[0] != 0) || (col2[1] != 0) || (col2[2] != 1))
260 isConvertableWithoutLoss =
false;
265 return isConvertableWithoutLoss;
270 assert(m_BoundingBox.IsNotNull());
271 Point3D c = m_BoundingBox->GetCenter();
280 this->IndexToWorld(c, c);
286 Vector3D diagonalvector = GetCornerPoint() - GetCornerPoint(
false,
false,
false);
287 return diagonalvector.GetSquaredNorm();
292 return sqrt(GetDiagonalLength2());
298 assert(this->IsBoundingBoxNull() ==
false);
306 FillVector3D(cornerpoint, bounds[0], bounds[2], bounds[4]);
309 FillVector3D(cornerpoint, bounds[0], bounds[2], bounds[5]);
312 FillVector3D(cornerpoint, bounds[0], bounds[3], bounds[4]);
315 FillVector3D(cornerpoint, bounds[0], bounds[3], bounds[5]);
318 FillVector3D(cornerpoint, bounds[1], bounds[2], bounds[4]);
321 FillVector3D(cornerpoint, bounds[1], bounds[2], bounds[5]);
324 FillVector3D(cornerpoint, bounds[1], bounds[3], bounds[4]);
327 FillVector3D(cornerpoint, bounds[1], bounds[3], bounds[5]);
331 itkExceptionMacro(<<
"A cube only has 8 corners. These are labeled 0-7.");
338 FillVector3D(cornerpoint, cornerpoint[0] - 0.5, cornerpoint[1] - 0.5, cornerpoint[2] - 0.5);
340 return this->GetIndexToWorldTransform()->TransformPoint(cornerpoint);
345 assert(this->IsBoundingBoxNull() ==
false);
349 cornerpoint[0] = (xFront ? bounds[0] : bounds[1]);
350 cornerpoint[1] = (yFront ? bounds[2] : bounds[3]);
351 cornerpoint[2] = (zFront ? bounds[4] : bounds[5]);
356 FillVector3D(cornerpoint, cornerpoint[0] - 0.5, cornerpoint[1] - 0.5, cornerpoint[2] - 0.5);
359 return this->GetIndexToWorldTransform()->TransformPoint(cornerpoint);
364 return this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(direction).magnitude() *
365 GetExtent(direction);
375 AffineTransform3D::MatrixType::InternalMatrixType vnlmatrix;
376 vnlmatrix = m_GeometryTransform->GetVnlMatrix();
377 if (len > extentInMM)
378 vnlmatrix.set_column(direction, vnlmatrix.get_column(direction) / len * extentInMM);
380 vnlmatrix.set_column(direction, vnlmatrix.get_column(direction) * extentInMM / len);
383 m_GeometryTransform->SetMatrix(matrix);
392 WorldToIndex(p, index);
393 return IsIndexInside(index);
404 discretIndex[0] = itk::Math::RoundHalfIntegerUp<mitk::ScalarType>(index[0]);
405 discretIndex[1] = itk::Math::RoundHalfIntegerUp<mitk::ScalarType>(index[1]);
406 discretIndex[2] = itk::Math::RoundHalfIntegerUp<mitk::ScalarType>(index[2]);
408 inside = this->GetBoundingBox()->IsInside(discretIndex);
414 if ((discretIndex[0] == bounds[1]) || (discretIndex[1] == bounds[3]) || (discretIndex[2] == bounds[5]))
419 inside = this->GetBoundingBox()->IsInside(index);
427 const TransformType::OffsetType &
offset = this->GetIndexToWorldTransform()->GetOffset();
428 tempIn = pt_mm.GetVectorFromOrigin() -
offset;
430 WorldToIndex(tempIn, tempOut);
438 if (m_IndexToWorldTransformLastModified != this->GetIndexToWorldTransform()->GetMTime())
440 if (!m_InvertedTransform)
444 if (!this->GetIndexToWorldTransform()->GetInverse(m_InvertedTransform.GetPointer()))
446 itkExceptionMacro(
"Internal ITK matrix inversion error, cannot proceed.");
448 m_IndexToWorldTransformLastModified = this->GetIndexToWorldTransform()->GetMTime();
452 const TransformType::MatrixType &inverse = m_InvertedTransform->GetMatrix();
453 if (inverse.GetVnlMatrix().has_nans())
455 itkExceptionMacro(
"Internal ITK matrix inversion error, cannot proceed. Matrix was: "
457 << this->GetIndexToWorldTransform()->GetMatrix()
458 <<
"Suggested inverted matrix is:"
463 vec_units = inverse * vec_mm;
470 MITK_WARN <<
"Warning! Call of the deprecated function BaseGeometry::WorldToIndex(point, vec, vec). Use "
471 "BaseGeometry::WorldToIndex(vec, vec) instead!";
472 this->WorldToIndex(vec_mm, vec_units);
477 return const_cast<Self *
>(
this)->GetOrigin().GetVnlVector();
482 return m_GeometryTransform->GetVtkTransform();
489 m_GeometryTransform->SetIdentity();
496 m_GeometryTransform->Compose(other, pre);
504 Compose(itkTransform, pre);
509 if ((vector[0] != 0) || (vector[1] != 0) || (vector[2] != 0))
511 this->SetOrigin(this->GetOrigin() + vector);
517 pt_mm = this->GetIndexToWorldTransform()->TransformPoint(pt_units);
522 vec_mm = this->GetIndexToWorldTransform()->TransformVector(vec_units);
530 vtktransform->SetMatrix(this->GetVtkMatrix());
538 if (pointOp ==
nullptr)
540 MITK_ERROR <<
"Point move operation is null!";
545 vtktransform->GetPosition(data);
546 vtktransform->PostMultiply();
547 vtktransform->Translate(newPos[0], newPos[1], newPos[2]);
548 vtktransform->PreMultiply();
554 if (scaleOp ==
nullptr)
562 scalefactor[0] = 1 + (newScale[0] / GetMatrixColumn(0).magnitude());
563 scalefactor[1] = 1 + (newScale[1] / GetMatrixColumn(1).magnitude());
564 scalefactor[2] = 1 + (newScale[2] / GetMatrixColumn(2).magnitude());
568 vtktransform->PostMultiply();
569 vtktransform->Translate(-anchor[0], -anchor[1], -anchor[2]);
570 vtktransform->Scale(scalefactor[0], scalefactor[1], scalefactor[2]);
571 vtktransform->Translate(anchor[0], anchor[1], anchor[2]);
577 if (rotateOp ==
nullptr)
585 vtktransform->PostMultiply();
586 vtktransform->Translate(-center[0], -center[1], -center[2]);
587 vtktransform->RotateWXYZ(angle, rotationVector[0], rotationVector[1], rotationVector[2]);
588 vtktransform->Translate(center[0], center[1], center[2]);
589 vtktransform->PreMultiply();
597 dynamic_cast<mitk::RestorePlanePositionOperation *>(operation)->GetTransform().GetPointer(), matrix);
598 vtktransform->SetMatrix(matrix);
605 vtktransform->SetMatrix(applyMatrixOp->
GetMatrix());
609 vtktransform->Delete();
612 this->SetVtkMatrixDeepCopy(vtktransform);
614 vtktransform->Delete();
619 return this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(direction);
627 mitk::BoundingBox::PointIdentifier pointid = 0;
630 if (transform !=
nullptr)
633 transform->GetInverse(inverse);
634 for (i = 0; i < 8; ++i)
635 pointscontainer->InsertElement(pointid++, inverse->TransformPoint(GetCornerPoint(i)));
639 for (i = 0; i < 8; ++i)
640 pointscontainer->InsertElement(pointid++, GetCornerPoint(i));
644 result->SetPoints(pointscontainer);
645 result->ComputeBoundingBox();
652 std::ostringstream out;
656 for (
int i = 0; i < 3; ++i)
659 for (
int j = 0; j < 3; ++j)
660 out << transformType->GetMatrix().GetVnlMatrix().get(i, j) <<
' ';
666 for (
int i = 0; i < 3; ++i)
667 out << transformType->GetOffset()[i] <<
' ';
676 m_GeometryTransform->SetIndexToWorldTransformByVtkMatrix(vtkmatrix);
681 m_GeometryTransform->SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkmatrix);
688 MITK_WARN <<
"Warning! Call of the deprecated function BaseGeometry::IndexToWorld(point, vec, vec). Use "
689 "BaseGeometry::IndexToWorld(vec, vec) instead!";
691 this->IndexToWorld(vec_units, vec_mm);
696 return m_GeometryTransform->GetVtkMatrix();
701 return m_BoundingBox.IsNull();
706 return m_GeometryTransform->IsIndexToWorldTransformNull();
716 if (m_ImageGeometry == isAnImageGeometry)
722 FillVector3D(originIndex, boundsarray[0], boundsarray[2], boundsarray[4]);
724 if (isAnImageGeometry ==
true)
725 FillVector3D(originIndex, originIndex[0] + 0.5, originIndex[1] + 0.5, originIndex[2] + 0.5);
727 FillVector3D(originIndex, originIndex[0] - 0.5, originIndex[1] - 0.5, originIndex[2] - 0.5);
731 originWorld = GetIndexToWorldTransform()->TransformPoint(originIndex);
734 SetOrigin(originWorld);
736 this->SetImageGeometry(isAnImageGeometry);
741 os << indent <<
" IndexToWorldTransform: ";
742 if (this->IsIndexToWorldTransformNull())
743 os <<
"NULL" << std::endl;
749 os << indent <<
"Matrix: " << std::endl;
750 for (i = 0; i < 3; i++)
752 os << indent.GetNextIndent();
753 for (j = 0; j < 3; j++)
755 os << this->GetIndexToWorldTransform()->GetMatrix()[i][j] <<
" ";
760 os << indent <<
"Offset: " << this->GetIndexToWorldTransform()->GetOffset() << std::endl;
761 os << indent <<
"Center: " << this->GetIndexToWorldTransform()->GetCenter() << std::endl;
762 os << indent <<
"Translation: " << this->GetIndexToWorldTransform()->GetTranslation() << std::endl;
764 os << indent <<
"Inverse: " << std::endl;
765 for (i = 0; i < 3; i++)
767 os << indent.GetNextIndent();
768 for (j = 0; j < 3; j++)
770 os << this->GetIndexToWorldTransform()->GetInverseMatrix()[i][j] <<
" ";
776 os << indent <<
"Scale : ";
777 for (i = 0; i < 3; i++)
779 os << this->GetIndexToWorldTransform()->GetScale()[i] <<
" ";
784 os << indent <<
" BoundingBox: ";
785 if (this->IsBoundingBoxNull())
786 os <<
"NULL" << std::endl;
789 os << indent <<
"( ";
790 for (
unsigned int i = 0; i < 3; i++)
792 os << this->GetBoundingBox()->GetBounds()[2 * i] <<
"," << this->GetBoundingBox()->GetBounds()[2 * i + 1] <<
" ";
794 os <<
" )" << std::endl;
797 os << indent <<
" Origin: " << this->GetOrigin() << std::endl;
798 os << indent <<
" ImageGeometry: " << this->GetImageGeometry() << std::endl;
799 os << indent <<
" Spacing: " << this->GetSpacing() << std::endl;
804 if (!m_ModifiedLockFlag)
805 Superclass::Modified();
807 m_ModifiedCalledFlag =
true;
812 return m_GeometryTransform->GetIndexToWorldTransform();
817 return m_GeometryTransform->GetIndexToWorldTransform();
822 return m_GeometryTransform;
830 if ((leftHandSide ==
nullptr) || (rightHandSide ==
nullptr))
832 MITK_ERROR <<
"mitk::Equal( const mitk::Geometry3D::BoundingBoxType *leftHandSide, const "
833 "mitk::Geometry3D::BoundingBoxType *rightHandSide, ScalarType eps, bool verbose ) does not with NULL "
837 return Equal(*leftHandSide, *rightHandSide, eps, verbose);
849 BaseGeometry::BoundsArrayType::Iterator itLeft = leftBounds.Begin();
850 for (BaseGeometry::BoundsArrayType::Iterator itRight = rightBounds.Begin(); itRight != rightBounds.End(); ++itRight)
856 MITK_INFO <<
"[( Geometry3D::BoundingBoxType )] bounds are not equal.";
857 MITK_INFO <<
"rightHandSide is " << setprecision(12) << *itRight <<
" : leftHandSide is " << *itLeft
858 <<
" and tolerance is " <<
eps;
872 if ((leftHandSide ==
nullptr) || (rightHandSide ==
nullptr))
874 MITK_ERROR <<
"mitk::Equal(const mitk::Geometry3D *leftHandSide, const mitk::Geometry3D *rightHandSide, ScalarType "
875 "eps, bool verbose) does not with NULL pointer input.";
878 return Equal(*leftHandSide, *rightHandSide, eps, verbose);
893 MITK_INFO <<
"[( Geometry3D )] Spacing differs.";
894 MITK_INFO <<
"rightHandSide is " << setprecision(12) << rightHandSide.
GetSpacing() <<
" : leftHandSide is "
905 MITK_INFO <<
"[( Geometry3D )] Origin differs.";
906 MITK_INFO <<
"rightHandSide is " << setprecision(12) << rightHandSide.
GetOrigin() <<
" : leftHandSide is "
907 << leftHandSide.
GetOrigin() <<
" and tolerance is " <<
eps;
913 for (
unsigned int i = 0; i < 3; ++i)
919 MITK_INFO <<
"[( Geometry3D )] AxisVector #" << i <<
" differ";
920 MITK_INFO <<
"rightHandSide is " << setprecision(12) << rightHandSide.
GetAxisVector(i) <<
" : leftHandSide is "
930 MITK_INFO <<
"[( Geometry3D )] Extent #" << i <<
" differ";
931 MITK_INFO <<
"rightHandSide is " << setprecision(12) << rightHandSide.
GetExtent(i) <<
" : leftHandSide is "
932 << leftHandSide.
GetExtent(i) <<
" and tolerance is " <<
eps;
943 MITK_INFO <<
"[( Geometry3D )] GetImageGeometry is different.";
955 MITK_INFO <<
"[( Geometry3D )] GetFrameOfReferenceID is different.";
981 if ((leftHandSide ==
nullptr) || (rightHandSide ==
nullptr))
983 MITK_ERROR <<
"mitk::Equal(const Geometry3D::TransformType *leftHandSide, const Geometry3D::TransformType "
984 "*rightHandSide, ScalarType eps, bool verbose ) does not with NULL pointer input.";
987 return Equal(*leftHandSide, *rightHandSide, eps, verbose);
1000 MITK_INFO <<
"[( Geometry3D::TransformType )] Index to World Transformation matrix differs.";
1001 MITK_INFO <<
"rightHandSide is " << setprecision(12) << rightHandSide.GetMatrix() <<
" : leftHandSide is "
1002 << leftHandSide.GetMatrix() <<
" and tolerance is " <<
eps;
void InitializeGeometry(Self *newGeometry) const
ScalarType GetExtent(unsigned int direction) const
Set the time bounds (in ms)
void TransferVtkMatrixToItkTransform(const vtkMatrix4x4 *vtkmatrix, TTransformType *itkTransform)
const Point3D GetOrigin() const
Get the origin, e.g. the upper-left corner of the plane.
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBoxType
itk::SmartPointer< Self > Pointer
vtkMatrix4x4 * GetVtkMatrix()
void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
Set the spacing (m_Spacing).
void SetIndexToWorldTransformWithoutChangingSpacing(mitk::AffineTransform3D *transform)
void SetIndexToWorldTransform(mitk::AffineTransform3D *transform)
bool MatrixEqualElementWise(const vnl_matrix_fixed< TCoordRep, NRows, NCols > &matrix1, const vnl_matrix_fixed< TCoordRep, NRows, NCols > &matrix2, mitk::ScalarType epsilon=mitk::eps)
Check for element-wise matrix equality with a user defined accuracy.
BoundingBoxType::BoundsArrayType BoundsArrayType
virtual const Vector3D GetVectorOfRotation()
GetVectorOfRotation getter for the rotation axis.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override
Base class of all Operation-classes.
virtual const Point3D GetCenterOfRotation()
GetCenterOfRotation getter for the anchor point of rotation.
virtual bool IsValid() const
Is this BaseGeometry in a state that is valid?
vnl_vector< ScalarType > VnlVector
bool IsIndexInside(const mitk::Point3D &index) const
Test whether the point p ((continous!)index coordinates in units) is inside the bounding box...
void SetIdentity()
Set the transform to identity, the spacing to 1 and origin to 0.
void _SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
GeometryTransformHolder::TransformType TransformType
double GetDiagonalLength2() const
Get the squared length of the diagonal of the bounding-box in mm.
ModifiedLock manages the calls of Modified() functions.
DataCollection - Class to facilitate loading/accessing structured data.
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
void TransferItkTransformToVtkMatrix(const TTransformType *itkTransform, vtkMatrix4x4 *vtkmatrix)
void Initialize()
Initialize the BaseGeometry.
Constants for most interaction classes, due to the generic StateMachines.
Point3D GetScaleAnchorPoint()
GetScaleAnchorPoint getter for anchor point.
VnlVector GetMatrixColumn(unsigned int direction) const
Get a VnlVector along bounding-box in the specified direction, length is spacing. ...
const BoundsArrayType GetBounds() const
void Translate(const Vector3D &vector)
Translate the origin by a vector.
VnlVector GetOriginVnl() const
Get the origin as VnlVector.
abstract class, that can be used by Undo to undo an operation.
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
virtual unsigned int GetFrameOfReferenceID() const
Get the DICOM FrameOfReferenceID referring to the used world coordinate system.
virtual ScalarType GetAngleOfRotation()
GetAngleOfRotation getter for rotation angle.
static const std::string GetTransformAsString(TransformType *transformType)
void SetVtkMatrixDeepCopy(vtkTransform *vtktransform)
Vector3D GetAxisVector(unsigned int direction) const
Get vector along bounding-box in the specified direction in mm.
void SetOrigin(const Point3D &origin)
Set the origin, i.e. the upper-left corner of the plane.
void Modified() const override
Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class...
Operation that handles all actions on one Point.
void Compose(const TransformType *other, bool pre=0)
Compose new IndexToWorldTransform with a given transform.
itk::AffineGeometryFrame< ScalarType, 3 >::TransformType AffineTransform3D
Point3D GetCenter() const
Get the center of the bounding-box in mm.
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...
Point3D GetCornerPoint(int id) const
Get the position of the corner number id (in world coordinates)
virtual void ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry)
When switching from an Image Geometry to a normal Geometry (and the other way around), you have to.
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.
void SetBounds(const BoundsArrayType &bounds)
Set the bounding box (in index/unit coordinates)
Point3D GetScaleFactor()
GetScaleFactor getter for the scale factor.
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)...
The ScaleOperation is an operation to scale any mitk::BaseGeometry.
void SetExtentInMM(int direction, ScalarType extentInMM)
Set the extent of the bounding-box in the specified direction in mm.
void SetIndexToWorldTransformByVtkMatrix(vtkMatrix4x4 *vtkmatrix)
Convenience method for setting the ITK transform (m_IndexToWorldTransform) via an vtkMatrix4x4...
bool IsIndexToWorldTransformNull() const
virtual void SetFrameOfReferenceID(unsigned int _arg)
Set the DICOM FrameOfReferenceID referring to the used world coordinate system.
MITKCORE_EXPORT const ScalarType eps
bool IsBoundingBoxNull() const
void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkMatrix4x4 *vtkmatrix)
Convenience method for setting the ITK transform (m_IndexToWorldTransform) via an vtkMatrix4x4...
double GetDiagonalLength() const
Get the length of the diagonal of the bounding-box in mm.
bool IsInside(const mitk::Point3D &p) const
Test whether the point p (world coordinates in mm) is inside the bounding box.
vtkLinearTransform * GetVtkTransform() const
Get the m_IndexToWorldTransform as a vtkLinearTransform.
OperationType GetOperationType()
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.
Operation, that holds everything necessary for an rotation operation on mitk::BaseData.
ScalarType GetExtentInMM(int direction) const
Get the extent of the bounding-box in the specified direction in mm.
const GeometryTransformHolder * GetGeometryTransformHolder() const
virtual bool GetImageGeometry() const
Is this an ImageGeometry?
BaseGeometry Describes the geometry of a data object.
virtual void ExecuteOperation(Operation *operation) override
executes affine operations (translate, rotate, scale)
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
BoundingBoxType::BoundsArrayType BoundsArrayType
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.
void SetFloatBounds(const float bounds[6])
Set the bounding box (in index/unit coordinates) via a float array.
virtual const BoundingBoxType * GetBoundingBox()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.