Medical Imaging Interaction Toolkit  2018.4.99-36d69b77
Medical Imaging Interaction Toolkit
mitkTimeGeometry.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 TimeGeometry_h
14 #define TimeGeometry_h
15 
16 // ITK
17 #include <itkObject.h>
18 // MITK
19 #include "mitkOperationActor.h"
20 #include <MitkCoreExports.h>
21 #include <mitkBaseGeometry.h>
22 #include <mitkCommon.h>
23 
24 namespace mitk
25 {
27  typedef std::size_t TimeStepType;
28 
43  class MITKCORE_EXPORT TimeGeometry : public itk::Object, public OperationActor
44  {
45  protected:
46  TimeGeometry();
47  ~TimeGeometry() override;
48 
52  BoundingBox::Pointer m_BoundingBox;
53 
57  LightObject::Pointer InternalClone() const override;
58 
59  public:
61  itkCloneMacro(Self);
62  itkCreateAnotherMacro(Self);
63 
72  virtual TimeStepType CountTimeSteps() const = 0;
80  virtual TimePointType GetMinimumTimePoint() const = 0;
87  virtual TimePointType GetMaximumTimePoint() const = 0;
88 
95  virtual TimePointType GetMinimumTimePoint(TimeStepType step) const = 0;
101  virtual TimePointType GetMaximumTimePoint(TimeStepType step) const = 0;
102 
106  virtual TimeBounds GetTimeBounds() const = 0;
107 
111  virtual TimeBounds GetTimeBounds(TimeStepType step) const = 0;
118  virtual bool IsValidTimePoint(TimePointType timePoint) const = 0;
126  virtual bool IsValidTimeStep(TimeStepType timeStep) const = 0;
127 
137  virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const = 0;
147  virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const = 0;
148 
161  virtual BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const = 0;
174  virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const = 0;
175 
182  virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const = 0;
183 
190  virtual void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) = 0;
191 
199  virtual void Expand(TimeStepType size) = 0;
200 
211  virtual void ReplaceTimeStepGeometries(const BaseGeometry *geometry) = 0;
212 
216  virtual bool IsValid() const = 0;
222  Point3D GetCornerPointInWorld(int id) const;
223 
229  Point3D GetCornerPointInWorld(bool xFront = true, bool yFront = true, bool zFront = true) const;
230 
234  Point3D GetCenterInWorld() const;
235 
239  double GetDiagonalLength2InWorld() const;
240 
244  double GetDiagonalLengthInWorld() const;
245 
249  bool IsWorldPointInside(const mitk::Point3D &p) const;
250 
258  void UpdateBoundingBox();
259 
263  BoundingBox *GetBoundingBoxInWorld() const { return m_BoundingBox; }
267  BoundingBox::BoundsArrayType GetBoundsInWorld() const { return m_BoundingBox->GetBounds(); }
271  ScalarType GetExtentInWorld(unsigned int direction) const;
272 
276  virtual void Initialize();
277 
281  void Update();
282 
289  virtual void UpdateWithoutBoundingBox(){};
290 
294  void ExecuteOperation(Operation *op) override;
295 
296  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
297  }; // end class TimeGeometry
298 
317  MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry &leftHandSide,
318  const mitk::TimeGeometry &rightHandSide,
319  ScalarType eps,
320  bool verbose);
321 
322 } // end namespace MITK
323 #endif // TimeGeometry_h
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
BoundingBox * GetBoundingBoxInWorld() const
Returns a bounding box that covers all time steps.
#define MITKCORE_EXPORT
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Base class of all Operation-classes.
Definition: mitkOperation.h:29
double ScalarType
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:31
DataCollection - Class to facilitate loading/accessing structured data.
abstract class, that can be used by Undo to undo an operation.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
bool verbose(false)
mitk::ScalarType TimePointType
std::vcl_size_t TimeStepType
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 UpdateWithoutBoundingBox()
Updates everything except the Bounding box.
MITKCORE_EXPORT const ScalarType eps
BoundingBox::BoundsArrayType GetBoundsInWorld() const
Returns the world bounds of the object that cover all time steps.
BoundingBox::Pointer m_BoundingBox
Contains a bounding box which includes all time steps.
BaseGeometry Describes the geometry of a data object.
BoundingBoxType::BoundsArrayType BoundsArrayType