Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 mitkTimeGeometry_h
14 #define mitkTimeGeometry_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 
342  MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry& leftHandSide,
343  const mitk::TimeGeometry& rightHandSide,
344  ScalarType coordinateEps,
345  ScalarType directionEps,
346  bool verbose);
347 
348 } // end namespace MITK
349 #endif
mitk::eps
const MITKCORE_EXPORT ScalarType eps
mitk::OperationActor
abstract class, that can be used by Undo to undo an operation.
Definition: mitkOperationActor.h:41
mitk::TimeGeometry
Definition: mitkTimeGeometry.h:43
mitk::Operation
Base class of all Operation-classes.
Definition: mitkOperation.h:29
mitkOperationActor.h
mitk::Equal
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.
itk::SmartPointer< Self >
mitk::TimeGeometry::m_BoundingBox
BoundingBox::Pointer m_BoundingBox
Contains a bounding box which includes all time steps.
Definition: mitkTimeGeometry.h:52
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::BoundingBox
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
Definition: mitkBaseGeometry.h:40
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MitkCoreExports.h
mitk::BaseGeometry
BaseGeometry Describes the geometry of a data object.
Definition: mitkBaseGeometry.h:94
mitk::Point< ScalarType, 3 >
mitkCommon.h
mitk::TimeGeometry::UpdateWithoutBoundingBox
virtual void UpdateWithoutBoundingBox()
Updates everything except the Bounding box.
Definition: mitkTimeGeometry.h:289
mitk::TimeGeometry::GetBoundsInWorld
BoundingBox::BoundsArrayType GetBoundsInWorld() const
Returns the world bounds of the object that cover all time steps.
Definition: mitkTimeGeometry.h:267
mitk::TimeStepType
std::size_t TimeStepType
Definition: mitkTimeGeometry.h:27
mitkBaseGeometry.h
mitk::TimeGeometry::GetBoundingBoxInWorld
BoundingBox * GetBoundingBoxInWorld() const
Returns a bounding box that covers all time steps.
Definition: mitkTimeGeometry.h:263
mitk::TimePointType
mitk::ScalarType TimePointType
Definition: mitkTimeGeometry.h:26
mitk::TimeBounds
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Definition: mitkBaseGeometry.h:44
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20