Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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:
60  mitkClassMacroItkParent(TimeGeometry, itk::Object) itkCloneMacro(Self) itkCreateAnotherMacro(Self)
61 
62 
70  virtual TimeStepType CountTimeSteps() const = 0;
78  virtual TimePointType GetMinimumTimePoint() const = 0;
85  virtual TimePointType GetMaximumTimePoint() const = 0;
86 
93  virtual TimePointType GetMinimumTimePoint(TimeStepType step) const = 0;
99  virtual TimePointType GetMaximumTimePoint(TimeStepType step) const = 0;
100 
104  virtual TimeBounds GetTimeBounds() const = 0;
105 
109  virtual TimeBounds GetTimeBounds(TimeStepType step) const = 0;
116  virtual bool IsValidTimePoint(TimePointType timePoint) const = 0;
124  virtual bool IsValidTimeStep(TimeStepType timeStep) const = 0;
125 
135  virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const = 0;
145  virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const = 0;
146 
159  virtual BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const = 0;
172  virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const = 0;
173 
180  virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const = 0;
181 
188  virtual void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) = 0;
189 
197  virtual void Expand(TimeStepType size) = 0;
198 
209  virtual void ReplaceTimeStepGeometries(const BaseGeometry *geometry) = 0;
210 
214  virtual bool IsValid() const = 0;
220  Point3D GetCornerPointInWorld(int id) const;
221 
227  Point3D GetCornerPointInWorld(bool xFront = true, bool yFront = true, bool zFront = true) const;
228 
232  Point3D GetCenterInWorld() const;
233 
237  double GetDiagonalLength2InWorld() const;
238 
242  double GetDiagonalLengthInWorld() const;
243 
247  bool IsWorldPointInside(const mitk::Point3D &p) const;
248 
256  void UpdateBoundingBox();
257 
261  BoundingBox *GetBoundingBoxInWorld() const { return m_BoundingBox; }
265  BoundingBox::BoundsArrayType GetBoundsInWorld() const { return m_BoundingBox->GetBounds(); }
269  ScalarType GetExtentInWorld(unsigned int direction) const;
270 
274  virtual void Initialize();
275 
279  void Update();
280 
287  virtual void UpdateWithoutBoundingBox(){};
288 
292  void ExecuteOperation(Operation *op) override;
293 
294  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
295  }; // end class TimeGeometry
296 
315  MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry &leftHandSide,
316  const mitk::TimeGeometry &rightHandSide,
317  ScalarType eps,
318  bool verbose);
319 
320 } // end namespace MITK
321 #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