Medical Imaging Interaction Toolkit  2022.04.99-b2814023
Medical Imaging Interaction Toolkit
mitkBaseGeometry.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BaseGeometry_H_HEADER_INCLUDED
14 #define BaseGeometry_H_HEADER_INCLUDED
15 
16 #include "mitkOperationActor.h"
17 #include <MitkCoreExports.h>
18 #include <mitkCommon.h>
19 
20 #include "itkScalableAffineTransform.h"
21 #include "mitkNumericTypes.h"
22 #include <itkBoundingBox.h>
23 #include <itkIndex.h>
24 #include <itkQuaternionRigidTransform.h>
25 #include <mitkAffineTransform3D.h>
26 
28 #include <vtkTransform.h>
29 
30 class vtkMatrix4x4;
31 class vtkMatrixToLinearTransform;
32 class vtkLinearTransform;
33 
34 namespace mitk
35 {
36  //##Documentation
37  //## @brief Standard 3D-BoundingBox typedef
38  //##
39  //## Standard 3D-BoundingBox typedef to get rid of template arguments (3D, type).
40  typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBox;
41 
42  //##Documentation
43  //## @brief Standard typedef for time-bounds
44  typedef itk::FixedArray<ScalarType, 2> TimeBounds;
45  typedef itk::FixedArray<ScalarType, 3> FixedArrayType;
46 
47  //##Documentation
48  //## @brief BaseGeometry Describes the geometry of a data object
49  //##
50  //## The class holds
51  //## \li a bounding box which is axes-parallel in intrinsic coordinates
52  //## (often integer indices of pixels), to be accessed by
53  //## GetBoundingBox()
54  //## \li a transform to convert intrinsic coordinates into a
55  //## world-coordinate system with coordinates in millimeters
56  //## and milliseconds (all are floating point values), to
57  //## be accessed by GetIndexToWorldTransform()
58  //## \li an origin and spacing to define the geometry
59  //##
60  //## BaseGeometry and its sub-classes allow converting between
61  //## intrinsic coordinates (called index or unit coordinates)
62  //## and world-coordinates (called world or mm coordinates),
63  //## e.g. WorldToIndex.
64  //## In case you need integer index coordinates, provide an
65  //## mitk::Index3D (or itk::Index) as target variable to
66  //## WorldToIndex, otherwise you will get a continuous index
67  //## (floating point values).
68  //##
69  //## An important sub-class is SlicedGeometry3D, which descibes
70  //## data objects consisting of slices, e.g., objects of type Image.
71  //## Conversions between world coordinates (in mm) and unit coordinates
72  //## (e.g., pixels in the case of an Image) can be performed.
73  //##
74  //## For more information on related classes, see \ref Geometry.
75  //##
76  //## BaseGeometry instances referring to an Image need a slightly
77  //## different definition of corners, see SetImageGeometry. This
78  //## is usualy automatically called by Image.
79  //##
80  //## BaseGeometry have to be initialized in the method GenerateOutputInformation()
81  //## of BaseProcess (or CopyInformation/ UpdateOutputInformation of BaseData,
82  //## if possible, e.g., by analyzing pic tags in Image) subclasses. See also
83  //## itk::ProcessObject::GenerateOutputInformation(),
84  //## itk::DataObject::CopyInformation() and
85  //## itk::DataObject::UpdateOutputInformation().
86  //##
87  //## At least, it can return the bounding box of the data object.
88  //##
89  //## The BaseGeometry class is an abstract class. The most simple implementation
90  //## is the sublass Geometry3D.
91  //##
92  //## Rule: everything is in mm (ms) if not stated otherwise.
93  //## @ingroup Geometry
94  class MITKCORE_EXPORT BaseGeometry : public itk::Object, public OperationActor
95  {
96  public:
98  itkCloneMacro(Self);
99 
100  // ********************************** TypeDef **********************************
101 
103  typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBoxType;
104  typedef BoundingBoxType::BoundsArrayType BoundsArrayType;
105  typedef BoundingBoxType::Pointer BoundingBoxPointer;
106 
107  // ********************************** Origin, Spacing **********************************
108 
109  //##Documentation
110  //## @brief Get the origin, e.g. the upper-left corner of the plane
111  const Point3D GetOrigin() const;
112 
113  //##Documentation
114  //## @brief Set the origin, i.e. the upper-left corner of the plane
115  //##
116  void SetOrigin(const Point3D &origin);
117 
118  //##Documentation
119  //## @brief Get the spacing (size of a pixel).
120  //##
121  const mitk::Vector3D GetSpacing() const;
122 
123  //##Documentation
124  //## @brief Set the spacing (m_Spacing).
125  //##
126  //##The spacing is also changed in the IndexToWorldTransform.
127  void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing = false);
128 
129  //##Documentation
130  //## @brief Get the origin as VnlVector
131  //##
132  //## \sa GetOrigin
133  VnlVector GetOriginVnl() const;
134 
135  // ********************************** other functions **********************************
136 
137  //##Documentation
138  //## @brief Get the DICOM FrameOfReferenceID referring to the
139  //## used world coordinate system
140  itkGetConstMacro(FrameOfReferenceID, unsigned int);
141  //##Documentation
142  //## @brief Set the DICOM FrameOfReferenceID referring to the
143  //## used world coordinate system
144  itkSetMacro(FrameOfReferenceID, unsigned int);
145 
146  itkGetConstMacro(IndexToWorldTransformLastModified, unsigned long);
147 
148  //##Documentation
149  //## @brief Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class.
150  //##
151  //## For the use of Modified(), see class ModifiedLock.
152  void Modified() const override;
153 
154  friend class ModifiedLock;
155 
156  //##Documentation
157  //## @brief Is this BaseGeometry in a state that is valid?
158  //##
159  //## This function returns always true in the BaseGeometry class. Other implementations are possible in subclasses.
160  virtual bool IsValid() const;
161 
162  // ********************************** Initialize **********************************
163 
164  //##Documentation
165  //## @brief Initialize the BaseGeometry
166  void Initialize();
167 
168  void InitializeGeometry(Self *newGeometry) const;
169 
170  // ********************************** Transformations Set/Get **********************************
171 
172  //##Documentation
173  //## @brief Get the transformation used to convert from index
174  //## to world coordinates
175  mitk::AffineTransform3D *GetIndexToWorldTransform();
176 
177  //##Documentation
178  //## @brief Get the transformation used to convert from index
179  //## to world coordinates
180  const mitk::AffineTransform3D *GetIndexToWorldTransform() const;
181 
182  //## @brief Set the transformation used to convert from index
183  //## to world coordinates. The spacing of the new transform is
184  //## copied to m_spacing.
185  void SetIndexToWorldTransform(mitk::AffineTransform3D *transform);
186 
187  //##Documentation
188  //## @brief Convenience method for setting the ITK transform
189  //## (m_IndexToWorldTransform) via an vtkMatrix4x4.The spacing of
190  //## the new transform is copied to m_spacing.
191  //## \sa SetIndexToWorldTransform
192  void SetIndexToWorldTransformByVtkMatrix(vtkMatrix4x4 *vtkmatrix);
193 
194  //## @brief Set the transformation used to convert from index
195  //## to world coordinates.This function keeps the original spacing.
196  void SetIndexToWorldTransformWithoutChangingSpacing(mitk::AffineTransform3D *transform);
197 
198  //##Documentation
199  //## @brief Convenience method for setting the ITK transform
200  //## (m_IndexToWorldTransform) via an vtkMatrix4x4. This function keeps the original spacing.
201  //## \sa SetIndexToWorldTransform
202  void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkMatrix4x4 *vtkmatrix);
203 
204  //## Get the Vtk Matrix which describes the transform.
205  vtkMatrix4x4 *GetVtkMatrix();
206 
207  //##Documentation
208  //## @brief Get the m_IndexToWorldTransform as a vtkLinearTransform
209  vtkLinearTransform *GetVtkTransform() const;
210 
211  //##Documentation
212  //## @brief Set the transform to identity, the spacing to 1 and origin to 0
213  //##
214  void SetIdentity();
215 
216  // ********************************** Transformations **********************************
217 
218  //##Documentation
219  //## @brief Compose new IndexToWorldTransform with a given transform.
220  //##
221  //## This method composes m_IndexToWorldTransform with another transform,
222  //## modifying self to be the composition of self and other.
223  //## If the argument pre is true, then other is precomposed with self;
224  //## that is, the resulting transformation consists of first applying
225  //## other to the source, followed by self. If pre is false or omitted,
226  //## then other is post-composed with self; that is the resulting
227  //## transformation consists of first applying self to the source,
228  //## followed by other.
229  //## This method also changes m_spacing.
230  void Compose(const TransformType *other, bool pre = false);
231 
232  //##Documentation
233  //## @brief Compose new IndexToWorldTransform with a given vtkMatrix4x4.
234  //##
235  //## Converts the vtkMatrix4x4 into a itk-transform and calls the previous method.
236  void Compose(const vtkMatrix4x4 *vtkmatrix, bool pre = false);
237 
238  //##Documentation
239  //## @brief Translate the origin by a vector
240  //##
241  void Translate(const Vector3D &vector);
242 
243  //##Documentation
244  //##@brief executes affine operations (translate, rotate, scale)
245  void ExecuteOperation(Operation *operation) override;
246 
247  //##Documentation
248  //## @brief Convert world coordinates (in mm) of a \em point to (continuous!) index coordinates
249  //## \warning If you need (discrete) integer index coordinates (e.g., for iterating easily over an image),
250  //## use WorldToIndex(const mitk::Point3D& pt_mm, itk::Index<VIndexDimension> &index).
251  //## For further information about coordinates types, please see the Geometry documentation
252  void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const;
253 
254  //##Documentation
255  //## @brief Convert world coordinates (in mm) of a \em vector
256  //## \a vec_mm to (continuous!) index coordinates.
257  //## For further information about coordinates types, please see the Geometry documentation
258  void WorldToIndex(const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const;
259 
260  //##Documentation
261  //## @brief Convert world coordinates (in mm) of a \em point to (discrete!) index coordinates.
262  //## This method rounds to integer indices!
263  //## For further information about coordinates types, please see the Geometry documentation
264  template <unsigned int VIndexDimension>
265  void WorldToIndex(const mitk::Point3D &pt_mm, itk::Index<VIndexDimension> &index) const
266  {
267  typedef itk::Index<VIndexDimension> IndexType;
268  mitk::Point3D pt_units;
269  this->WorldToIndex(pt_mm, pt_units);
270  int i, dim = index.GetIndexDimension();
271  if (dim > 3)
272  {
273  index.Fill(0);
274  dim = 3;
275  }
276  for (i = 0; i < dim; ++i)
277  {
278  index[i] = itk::Math::RoundHalfIntegerUp<typename IndexType::IndexValueType>(pt_units[i]);
279  }
280  }
281 
282  //##Documentation
283  //## @brief Convert (continuous or discrete) index coordinates of a \em vector
284  //## \a vec_units to world coordinates (in mm)
285  //## For further information about coordinates types, please see the Geometry documentation
286  void IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const;
287 
288  //##Documentation
289  //## @brief Convert (continuous or discrete) index coordinates of a \em point to world coordinates (in mm)
290  //## For further information about coordinates types, please see the Geometry documentation
291  void IndexToWorld(const mitk::Point3D &pt_units, mitk::Point3D &pt_mm) const;
292 
293  //##Documentation
294  //## @brief Convert (discrete) index coordinates of a \em point to world coordinates (in mm)
295  //## For further information about coordinates types, please see the Geometry documentation
296  template <unsigned int VIndexDimension>
297  void IndexToWorld(const itk::Index<VIndexDimension> &index, mitk::Point3D &pt_mm) const
298  {
299  mitk::Point3D pt_units;
300  pt_units.Fill(0);
301  int i, dim = index.GetIndexDimension();
302  if (dim > 3)
303  {
304  dim = 3;
305  }
306  for (i = 0; i < dim; ++i)
307  {
308  pt_units[i] = index[i];
309  }
310 
311  IndexToWorld(pt_units, pt_mm);
312  }
313 
314  //##Documentation
315  //## @brief Convert (continuous or discrete) index coordinates of a \em vector
316  //## \a vec_units to world coordinates (in mm)
317  //## @deprecated First parameter (Point3D) is not used. If possible, please use void IndexToWorld(const
318  // mitk::Vector3D& vec_units, mitk::Vector3D& vec_mm) const.
319  //## For further information about coordinates types, please see the Geometry documentation
320  void IndexToWorld(const mitk::Point3D &atPt3d_units, const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const;
321 
322  //##Documentation
323  //## @brief Convert world coordinates (in mm) of a \em vector
324  //## \a vec_mm to (continuous!) index coordinates.
325  //## @deprecated First parameter (Point3D) is not used. If possible, please use void WorldToIndex(const
326  // mitk::Vector3D& vec_mm, mitk::Vector3D& vec_units) const.
327  //## For further information about coordinates types, please see the Geometry documentation
328  void WorldToIndex(const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const;
329 
330  //##Documentation
331  //## @brief Deprecated for use with ITK version 3.10 or newer.
332  //## Convert ITK physical coordinates of a \em point (in mm,
333  //## but without a rotation) into MITK world coordinates (in mm)
334  //##
335  //## For more information, see WorldToItkPhysicalPoint.
336  template <class TCoordRep>
337  void ItkPhysicalPointToWorld(const itk::Point<TCoordRep, 3> &itkPhysicalPoint, mitk::Point3D &pt_mm) const
338  {
339  mitk::vtk2itk(itkPhysicalPoint, pt_mm);
340  }
341 
342  //##Documentation
343  //## @brief Deprecated for use with ITK version 3.10 or newer.
344  //## Convert world coordinates (in mm) of a \em point to
345  //## ITK physical coordinates (in mm, but without a possible rotation)
346  //##
347  //## This method is useful if you have want to access an mitk::Image
348  //## via an itk::Image. ITK v3.8 and older did not support rotated (tilted)
349  //## images, i.e., ITK images are always parallel to the coordinate axes.
350  //## When accessing a (possibly rotated) mitk::Image via an itk::Image
351  //## the rotational part of the transformation in the BaseGeometry is
352  //## simply discarded; in other word: only the origin and spacing is
353  //## used by ITK, not the complete matrix available in MITK.
354  //## With WorldToItkPhysicalPoint you can convert an MITK world
355  //## coordinate (including the rotation) into a coordinate that
356  //## can be used with the ITK image as a ITK physical coordinate
357  //## (excluding the rotation).
358  template <class TCoordRep>
359  void WorldToItkPhysicalPoint(const mitk::Point3D &pt_mm, itk::Point<TCoordRep, 3> &itkPhysicalPoint) const
360  {
361  mitk::vtk2itk(pt_mm, itkPhysicalPoint);
362  }
363 
364  // ********************************** BoundingBox **********************************
365 
367  itkGetConstObjectMacro(BoundingBox, BoundingBoxType);
368 
369 // a bit of a misuse, but we want only doxygen to see the following:
370 #ifdef DOXYGEN_SKIP
371  //##Documentation
372  //## @brief Get bounding box (in index/unit coordinates)
373  itkGetConstObjectMacro(BoundingBox, BoundingBoxType);
374  //##Documentation
375  //## @brief Get bounding box (in index/unit coordinates) as a BoundsArrayType
376  const BoundsArrayType GetBounds() const;
377 #endif
378  const BoundsArrayType GetBounds() const;
379 
380  //##Documentation
381  //## \brief Set the bounding box (in index/unit coordinates)
382  //##
383  //## Only possible via the BoundsArray to make clear that a
384  //## copy of the bounding-box is stored, not a reference to it.
385  void SetBounds(const BoundsArrayType &bounds);
386 
387  //##Documentation
388  //## @brief Set the bounding box (in index/unit coordinates) via a float array
389  void SetFloatBounds(const float bounds[6]);
390  //##Documentation
391  //## @brief Set the bounding box (in index/unit coordinates) via a double array
392  void SetFloatBounds(const double bounds[6]);
393 
394  //##Documentation
395  //## @brief Get a VnlVector along bounding-box in the specified
396  //## @a direction, length is spacing
397  //##
398  //## \sa GetAxisVector
399  VnlVector GetMatrixColumn(unsigned int direction) const;
400 
401  //##Documentation
402  //## @brief Calculates a bounding-box around the geometry relative
403  //## to a coordinate system defined by a transform
404  //##
405  mitk::BoundingBox::Pointer CalculateBoundingBoxRelativeToTransform(const mitk::AffineTransform3D *transform) const;
406 
407 //##Documentation
408 //## @brief Set the time bounds (in ms)
409 // void SetTimeBounds(const TimeBounds& timebounds);
410 
411 // ********************************** Geometry **********************************
412 
413 #ifdef DOXYGEN_SKIP
414  //##Documentation
415  //## @brief Get the extent of the bounding box (in index/unit coordinates)
416  //##
417  //## To access the extent in mm use GetExtentInMM
418  ScalarType GetExtent(unsigned int direction) const;
419 #endif
420 
422  ScalarType GetExtent(unsigned int direction) const;
423 
424  //##Documentation
425  //## @brief Get the extent of the bounding-box in the specified @a direction in mm
426  //##
427  //## Equals length of GetAxisVector(direction).
428  ScalarType GetExtentInMM(int direction) const;
429 
430  //##Documentation
431  //## @brief Get vector along bounding-box in the specified @a direction in mm
432  //##
433  //## The length of the vector is the size of the bounding-box in the
434  //## specified @a direction in mm
435  //## \sa GetMatrixColumn
436  Vector3D GetAxisVector(unsigned int direction) const;
437 
438  //##Documentation
439  //## @brief Checks, if the given geometry can be converted to 2D without information loss
440  //## e.g. when a 2D image is saved, the matrix is usually cropped to 2x2, and when you load it back to MITK
441  //## it will be filled with standard values. This function checks, if information would be lost during this
442  //## procedure
443  virtual bool Is2DConvertable();
444 
445  //##Documentation
446  //## @brief Get the center of the bounding-box in mm
447  //##
448  Point3D GetCenter() const;
449 
450  //##Documentation
451  //## @brief Get the squared length of the diagonal of the bounding-box in mm
452  //##
453  double GetDiagonalLength2() const;
454 
455  //##Documentation
456  //## @brief Get the length of the diagonal of the bounding-box in mm
457  //##
458  double GetDiagonalLength() const;
459 
460  //##Documentation
461  //## @brief Get the position of the corner number \a id (in world coordinates)
462  //##
463  //## See SetImageGeometry for how a corner is defined on images.
464  Point3D GetCornerPoint(int id) const;
465 
466  //##Documentation
467  //## @brief Get the position of a corner (in world coordinates)
468  //##
469  //## See SetImageGeometry for how a corner is defined on images.
470  Point3D GetCornerPoint(bool xFront = true, bool yFront = true, bool zFront = true) const;
471 
472  //##Documentation
473  //## @brief Set the extent of the bounding-box in the specified @a direction in mm
474  //##
475  //## @note This changes the matrix in the transform, @a not the bounds, which are given in units!
476  void SetExtentInMM(int direction, ScalarType extentInMM);
477 
478  //##Documentation
479  //## @brief Test whether the point \a p (world coordinates in mm) is
480  //## inside the bounding box
481  bool IsInside(const mitk::Point3D &p) const;
482 
483  //##Documentation
484  //## @brief Test whether the point \a p ((continous!)index coordinates in units) is
485  //## inside the bounding box
486  bool IsIndexInside(const mitk::Point3D &index) const;
487 
488  //##Documentation
489  //## @brief Convenience method for working with ITK indices
490  template <unsigned int VIndexDimension>
492  {
493  int i, dim = index.GetIndexDimension();
494  Point3D pt_index;
495  pt_index.Fill(0);
496  for (i = 0; i < dim; ++i)
497  {
498  pt_index[i] = index[i];
499  }
500  return IsIndexInside(pt_index);
501  }
502 
503  // ********************************* Image Geometry ********************************
504  //##Documentation
505  //## @brief When switching from an Image Geometry to a normal Geometry (and the other way around), you have to
506  //change
507  // the origin as well (See Geometry Documentation)! This function will change the "isImageGeometry" bool flag and
508  // changes the origin respectively.
509  virtual void ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry);
510 
511  //##Documentation
512  //## @brief Is this an ImageGeometry?
513  //##
514  //## For more information, see SetImageGeometry
515  itkGetConstMacro(ImageGeometry, bool)
516  //##Documentation
517  //## @brief Define that this BaseGeometry is refering to an Image
518  //##
519  //## A geometry referring to an Image needs a slightly different
520  //## definition of the position of the corners (see GetCornerPoint).
521  //## The position of a voxel is defined by the position of its center.
522  //## If we would use the origin (position of the (center of) the first
523  //## voxel) as a corner and display this point, it would seem to be
524  //## \em not at the corner but a bit within the image. Even worse for
525  //## the opposite corner of the image: here the corner would appear
526  //## outside the image (by half of the voxel diameter). Thus, we have
527  //## to correct for this and to be able to do that, we need to know
528  //## that the BaseGeometry is referring to an Image.
529  itkSetMacro(ImageGeometry, bool);
530  itkBooleanMacro(ImageGeometry);
531 
532  const GeometryTransformHolder *GetGeometryTransformHolder() const;
533 
534  protected:
535  // ********************************** Constructor **********************************
536  BaseGeometry();
537  BaseGeometry(const BaseGeometry &other);
538  ~BaseGeometry() override;
539 
540  itk::LightObject::Pointer InternalClone() const override = 0;
541 
542  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
543 
544  static const std::string GetTransformAsString(TransformType *transformType);
545 
546  itkGetConstMacro(NDimensions, unsigned int);
547 
548  bool IsBoundingBoxNull() const;
549 
550  bool IsIndexToWorldTransformNull() const;
551 
552  void SetVtkMatrixDeepCopy(vtkTransform *vtktransform);
553 
554  void _SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing = false);
555 
556  //##Documentation
557  //## @brief PreSetSpacing
558  //##
559  //## These virtual function allows a different beahiour in subclasses.
560  //## Do implement them in every subclass of BaseGeometry. If not needed, use
561  //## {Superclass::PreSetSpacing();};
562  virtual void PreSetSpacing(const mitk::Vector3D & /*aSpacing*/){};
563 
564  //##Documentation
565  //## @brief CheckBounds
566  //##
567  //## This function is called in SetBounds. Assertions can be implemented in this function (see PlaneGeometry.cpp).
568  //## If you implement this function in a subclass, make sure, that all classes were your class inherits from
569  //## have an implementation of CheckBounds
570  //## (e.g. inheritance BaseGeometry <- A <- B. Implementation of CheckBounds in class B needs implementation in A as
571  // well!)
572  virtual void CheckBounds(const BoundsArrayType & /*bounds*/){};
573 
574  //##Documentation
575  //## @brief CheckIndexToWorldTransform
576  //##
577  //## This function is called in SetIndexToWorldTransform. Assertions can be implemented in this function (see
578  // PlaneGeometry.cpp).
579  //## In Subclasses of BaseGeometry, implement own conditions or call Superclass::CheckBounds(bounds);.
580  virtual void CheckIndexToWorldTransform(mitk::AffineTransform3D * /*transform*/){};
581 
582  private:
583  GeometryTransformHolder *m_GeometryTransform;
584 
585  void InitializeGeometryTransformHolder(const BaseGeometry *otherGeometry);
586 
587  //##Documentation
588  //## @brief Bounding Box, which is axes-parallel in intrinsic coordinates
589  //## (often integer indices of pixels)
590  BoundingBoxPointer m_BoundingBox;
591 
592  unsigned int m_FrameOfReferenceID;
593 
594  // mitk::TimeBounds m_TimeBounds;
595 
596  static const unsigned int m_NDimensions = 3;
597 
598  mutable TransformType::Pointer m_InvertedTransform;
599 
600  mutable unsigned long m_IndexToWorldTransformLastModified;
601 
602  bool m_ImageGeometry;
603 
604  //##Documentation
605  //## @brief ModifiedLockFlag is used to prohibit the call of Modified()
606  //##
607  //## For the use of this Flag, see class ModifiedLock. This flag should only be set
608  //## by the ModifiedLock class!
609  bool m_ModifiedLockFlag;
610 
611  //##Documentation
612  //## @brief ModifiedcalledFlag is used to collect calls of Modified().
613  //##
614  //## For the use of this Flag, see class ModifiedLock. This flag should only be set
615  //## by the Modified() function!
616  mutable bool m_ModifiedCalledFlag;
617  };
618 
619  // ********************************** Equal Functions **********************************
620  //
621  // Static compare functions mainly for testing
622  //
642  MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry& leftHandSide,
643  const mitk::BaseGeometry& rightHandSide,
644  ScalarType coordinateEps,
645  ScalarType directionEps,
646  bool verbose = false);
647 
662  MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry &leftHandSide,
663  const mitk::BaseGeometry &rightHandSide,
665  bool verbose = false);
666 
682  const mitk::BaseGeometry::TransformType &rightHandSide,
683  ScalarType eps,
684  bool verbose);
685 
701  const mitk::BaseGeometry::BoundingBoxType &rightHandSide,
702  ScalarType eps,
703  bool verbose);
704 
727  const mitk::BaseGeometry& referenceGeo,
728  ScalarType coordinateEps,
729  ScalarType directionEps,
730  bool verbose = false);
731 
746  const mitk::BaseGeometry& referenceGeo,
747  ScalarType eps = mitk::eps,
748  bool verbose = false);
749 
750 } // namespace mitk
751 
752 #endif /* BaseGeometry_H_HEADER_INCLUDED */
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBoxType
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
MITKCORE_EXPORT const ScalarType eps
#define MITKCORE_EXPORT
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 ...
BoundingBoxType::BoundsArrayType BoundsArrayType
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Base class of all Operation-classes.
Definition: mitkOperation.h:29
vnl_vector< ScalarType > VnlVector
Definition: mitkVector.h:141
double ScalarType
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...
GeometryTransformHolder::TransformType TransformType
ModifiedLock manages the calls of Modified() functions.
DataCollection - Class to facilitate loading/accessing structured data.
virtual void CheckIndexToWorldTransform(mitk::AffineTransform3D *)
CheckIndexToWorldTransform.
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 ...
abstract class, that can be used by Undo to undo an operation.
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.
virtual void CheckBounds(const BoundsArrayType &)
CheckBounds.
virtual void PreSetSpacing(const mitk::Vector3D &)
PreSetSpacing.
MITKCORE_EXPORT bool IsSubGeometry(const mitk::BaseGeometry &testGeo, const mitk::BaseGeometry &referenceGeo, ScalarType coordinateEps, ScalarType directionEps, bool verbose=false)
A function checks if a test geometry is a sub geometry of a given reference geometry.
bool IsIndexInside(const itk::Index< VIndexDimension > &index) const
Convenience method for working with ITK indices.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
itk::ScalableAffineTransform< ScalarType, 3 > TransformType
void vtk2itk(const Tin &in, Tout &out)
itk::ScalableAffineTransform< ScalarType, 3 > AffineTransform3D
BoundingBoxType::Pointer BoundingBoxPointer
itk::FixedArray< ScalarType, 3 > FixedArrayType
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...
BaseGeometry Describes the geometry of a data object.