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