Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkArbitraryTimeGeometry.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 mitkArbitraryTimeGeometry_h
14 #define mitkArbitraryTimeGeometry_h
15 
16 //MITK
17 #include <mitkTimeGeometry.h>
18 #include <mitkCommon.h>
19 #include <MitkCoreExports.h>
20 
21 namespace mitk
22 {
45  {
46  public:
48 
50  typedef ArbitraryTimeGeometry self;
51  itkFactorylessNewMacro(Self);
52  itkCloneMacro(Self);
53 
62  TimeStepType CountTimeSteps() const override;
78 
92 
97  TimeBounds GetTimeBounds() const override;
98 
102  TimeBounds GetTimeBounds(TimeStepType step) const override;
103 
111  bool IsValidTimePoint(TimePointType timePoint) const override;
119  bool IsValidTimeStep(TimeStepType timeStep) const override;
143  TimeStepType TimePointToTimeStep(TimePointType timePoint) const override;
150  BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const override;
151 
161  BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const override;
171  BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const override;
172 
176  bool IsValid() const override;
177 
181  void Initialize() override;
182 
190  void Expand(TimeStepType size) override;
191 
202  void ReplaceTimeStepGeometries(const BaseGeometry *geometry) override;
203 
210  void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) override;
211 
216 
231  void AppendNewTimeStep(BaseGeometry *geometry, TimePointType minimumTimePoint, TimePointType maximumTimePoint);
232 
244  void AppendNewTimeStepClone(const BaseGeometry* geometry,
245  TimePointType minimumTimePoint,
246  TimePointType maximumTimePoint );
247 
256  void ReserveSpaceForGeometries( TimeStepType numberOfGeometries );
257 
258  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
259 
272 
273  protected:
276 
277  std::vector<BaseGeometry::Pointer> m_GeometryVector;
278  std::vector<TimePointType> m_MinimumTimePoints;
279  std::vector<TimePointType> m_MaximumTimePoints;
280 
282  }; // end class ArbitraryTimeGeometry
283 
284 } // end namespace MITK
285 #endif
#define MITKCORE_EXPORT
bool IsValidTimePoint(TimePointType timePoint) const override
Tests if a given time point is covered by this time geometry instance.
void ClearAllGeometries()
Remove all stored geometries and time bounds, leaving the container empty.
TimePointType GetMinimumTimePoint(TimeStepType step) const override
Returns the first time point for which the time geometry instance is valid.
std::vector< BaseGeometry::Pointer > m_GeometryVector
TimePointType GetMaximumTimePoint() const override
Returns the last time point for which the time geometry instance is valid.
void AppendNewTimeStepClone(const BaseGeometry *geometry, TimePointType minimumTimePoint, TimePointType maximumTimePoint)
Append a new time step with a clone of the given geometry.
TimePointType GetMinimumTimePoint() const override
Returns the first time point for which the time geometry instance is valid.
void Expand(TimeStepType size) override
Expands the time geometry to the given number of time steps.
mitkClassMacro(ArbitraryTimeGeometry, TimeGeometry)
ArbitraryTimeGeometry(const ArbitraryTimeGeometry &other)
bool IsValid() const override
Tests if all necessary information are set and the object is valid.
TimeStepType TimePointToTimeStep(TimePointType timePoint) const override
Converts a time point to the corresponding time step.
TimeBounds GetTimeBounds() const override
Get the time bounds (in ms) it returns GetMinimumTimePoint() and GetMaximumTimePoint() results as bou...
BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const override
Returns the geometry which corresponds to the given time point.
std::vector< TimePointType > m_MaximumTimePoints
std::vector< TimePointType > m_MinimumTimePoints
void ReplaceTimeStepGeometries(const BaseGeometry *geometry) override
Replaces the geometry instances with clones of the passed geometry.
void AppendNewTimeStep(BaseGeometry *geometry, TimePointType minimumTimePoint, TimePointType maximumTimePoint)
Append a new time step with the given geometry and time bounds.
BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const override
Returns the geometry which corresponds to the given time step.
TimePointType GetMaximumTimePoint(TimeStepType step) const override
Returns the last time point for which the time geometry instance is valid.
void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) override
Sets the geometry for the given time step.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
TimePointType TimeStepToTimePoint(TimeStepType timeStep) const override
Converts a time step to a time point.
TimeStepType CountTimeSteps() const override
Returns the number of time steps.
TimeBounds GetTimeBounds(TimeStepType step) const override
Get the time bounds for the given TimeStep (in ms)
BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const override
Returns the geometry which corresponds to the given time step.
bool IsValidTimeStep(TimeStepType timeStep) const override
Test for the given time step if a geometry is available.
void Initialize() override
Initializes a new object with one time steps which contains an empty geometry.
bool HasCollapsedFinalTimeStep() const
Check whether the final time step has collapsed (zero-duration) bounds.
void ReserveSpaceForGeometries(TimeStepType numberOfGeometries)
Pre-allocate space for a given number of geometries.
Abstract base class describing the geometry of a data object.
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).
itk::FixedArray< ScalarType, 2 > TimeBounds
Fixed-size array holding a pair of time bound values [min, max] in milliseconds.
mitk::ScalarType TimePointType
Type for time point values in milliseconds (ms).