Medical Imaging Interaction Toolkit  2024.06.00
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 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 
29  static const TimeStepType TIMESTEP_INVALID = -1;
30 
45  class MITKCORE_EXPORT TimeGeometry : public itk::Object, public OperationActor
46  {
47  protected:
48  TimeGeometry();
49  ~TimeGeometry() override;
50 
54  BoundingBox::Pointer m_BoundingBox;
55 
59  LightObject::Pointer InternalClone() const override;
60 
61  public:
63  itkCloneMacro(Self);
64  itkCreateAnotherMacro(Self);
65 
74  virtual TimeStepType CountTimeSteps() const = 0;
82  virtual TimePointType GetMinimumTimePoint() const = 0;
89  virtual TimePointType GetMaximumTimePoint() const = 0;
90 
97  virtual TimePointType GetMinimumTimePoint(TimeStepType step) const = 0;
103  virtual TimePointType GetMaximumTimePoint(TimeStepType step) const = 0;
104 
108  virtual TimeBounds GetTimeBounds() const = 0;
109 
113  virtual TimeBounds GetTimeBounds(TimeStepType step) const = 0;
120  virtual bool IsValidTimePoint(TimePointType timePoint) const = 0;
128  virtual bool IsValidTimeStep(TimeStepType timeStep) const = 0;
129 
139  virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const = 0;
149  virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const = 0;
150 
163  virtual BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const = 0;
176  virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const = 0;
177 
184  virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const = 0;
185 
192  virtual void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) = 0;
193 
201  virtual void Expand(TimeStepType size) = 0;
202 
213  virtual void ReplaceTimeStepGeometries(const BaseGeometry *geometry) = 0;
214 
218  virtual bool IsValid() const = 0;
224  Point3D GetCornerPointInWorld(int id) const;
225 
231  Point3D GetCornerPointInWorld(bool xFront = true, bool yFront = true, bool zFront = true) const;
232 
236  Point3D GetCenterInWorld() const;
237 
241  double GetDiagonalLength2InWorld() const;
242 
246  double GetDiagonalLengthInWorld() const;
247 
251  bool IsWorldPointInside(const mitk::Point3D &p) const;
252 
260  void UpdateBoundingBox();
261 
265  BoundingBox *GetBoundingBoxInWorld() const { return m_BoundingBox; }
269  BoundingBox::BoundsArrayType GetBoundsInWorld() const { return m_BoundingBox->GetBounds(); }
273  ScalarType GetExtentInWorld(unsigned int direction) const;
274 
278  virtual void Initialize();
279 
283  void Update();
284 
291  virtual void UpdateWithoutBoundingBox(){};
292 
296  void ExecuteOperation(Operation *op) override;
297 
298  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
299  }; // end class TimeGeometry
300 
319  MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry &leftHandSide,
320  const mitk::TimeGeometry &rightHandSide,
321  ScalarType eps,
322  bool verbose);
323 
344  MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry& leftHandSide,
345  const mitk::TimeGeometry& rightHandSide,
346  ScalarType coordinateEps,
347  ScalarType directionEps,
348  bool verbose);
349 
350 } // end namespace MITK
351 #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:45
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:54
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::TIMESTEP_INVALID
static const TimeStepType TIMESTEP_INVALID
Definition: mitkTimeGeometry.h:29
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:291
mitk::TimeGeometry::GetBoundsInWorld
BoundingBox::BoundsArrayType GetBoundsInWorld() const
Returns the world bounds of the object that cover all time steps.
Definition: mitkTimeGeometry.h:269
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:265
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