Medical Imaging Interaction Toolkit  2018.4.99-1640525a
Medical Imaging Interaction Toolkit
mitk::ArbitraryTimeGeometry Class Reference

#include <mitkArbitraryTimeGeometry.h>

Inheritance diagram for mitk::ArbitraryTimeGeometry:
Collaboration diagram for mitk::ArbitraryTimeGeometry:

Public Types

typedef ArbitraryTimeGeometry Self
 
typedef TimeGeometry Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef ArbitraryTimeGeometry self
 
- Public Types inherited from mitk::TimeGeometry
typedef TimeGeometry Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
 ArbitraryTimeGeometry ()
 
Pointer Clone () const
 
TimeStepType CountTimeSteps () const override
 Returns the number of time steps. More...
 
TimePointType GetMinimumTimePoint () const override
 Returns the first time point for which the time geometry instance is valid. More...
 
TimePointType GetMaximumTimePoint () const override
 Returns the last time point for which the time geometry instance is valid. More...
 
TimePointType GetMinimumTimePoint (TimeStepType step) const override
 Returns the first time point for which the time geometry instance is valid. More...
 
TimePointType GetMaximumTimePoint (TimeStepType step) const override
 Returns the last time point for which the time geometry instance is valid. More...
 
TimeBounds GetTimeBounds () const override
 Get the time bounds (in ms) it returns GetMinimumTimePoint() and GetMaximumTimePoint() results as bounds. More...
 
TimeBounds GetTimeBounds (TimeStepType step) const override
 Get the time bounds for the given TimeStep (in ms) More...
 
bool IsValidTimePoint (TimePointType timePoint) const override
 Tests if a given time point is covered by this time geometry instance. More...
 
bool IsValidTimeStep (TimeStepType timeStep) const override
 Test for the given time step if a geometry is availible. More...
 
TimePointType TimeStepToTimePoint (TimeStepType timeStep) const override
 Converts a time step to a time point. More...
 
TimeStepType TimePointToTimeStep (TimePointType timePoint) const override
 Converts a time point to the corresponding time step. More...
 
BaseGeometry::Pointer GetGeometryCloneForTimeStep (TimeStepType timeStep) const override
 Returns the geometry which corresponds to the given time step. More...
 
BaseGeometry::Pointer GetGeometryForTimePoint (TimePointType timePoint) const override
 Returns the geometry which corresponds to the given time point. More...
 
BaseGeometry::Pointer GetGeometryForTimeStep (TimeStepType timeStep) const override
 Returns the geometry which corresponds to the given time step. More...
 
bool IsValid () const override
 Tests if all necessary informations are set and the object is valid. More...
 
void Initialize () override
 Initializes a new object with one time steps which contains an empty geometry. More...
 
void Expand (TimeStepType size) override
 Expands the time geometry to the given number of time steps. More...
 
void ReplaceTimeStepGeometries (const BaseGeometry *geometry) override
 Replaces the geometry instances with clones of the passed geometry. More...
 
void SetTimeStepGeometry (BaseGeometry *geometry, TimeStepType timeStep) override
 Sets the geometry for the given time step. More...
 
itk::LightObject::Pointer InternalClone () const override
 Makes a deep copy of the current object. More...
 
void ClearAllGeometries ()
 
void AppendNewTimeStep (BaseGeometry *geometry, TimePointType minimumTimePoint, TimePointType maximumTimePoint)
 
void AppendNewTimeStepClone (const BaseGeometry *geometry, TimePointType minimumTimePoint, TimePointType maximumTimePoint)
 
void ReserveSpaceForGeometries (TimeStepType numberOfGeometries)
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
bool HasCollapsedFinalTimeStep () const
 
- Public Member Functions inherited from mitk::TimeGeometry
Pointer Clone () const
 
 itkCreateAnotherMacro (Self)
 
Point3D GetCornerPointInWorld (int id) const
 Get the position of the corner number id (in world coordinates) More...
 
Point3D GetCornerPointInWorld (bool xFront=true, bool yFront=true, bool zFront=true) const
 Get the position of a corner (in world coordinates) More...
 
Point3D GetCenterInWorld () const
 Get the center of the bounding-box in mm. More...
 
double GetDiagonalLength2InWorld () const
 Get the squared length of the diagonal of the bounding-box in mm. More...
 
double GetDiagonalLengthInWorld () const
 Get the length of the diagonal of the bounding-box in mm. More...
 
bool IsWorldPointInside (const mitk::Point3D &p) const
 Test whether the point p (world coordinates in mm) is inside the bounding box. More...
 
void UpdateBoundingBox ()
 Updates the bounding box to cover the area used in all time steps. More...
 
BoundingBoxGetBoundingBoxInWorld () const
 Returns a bounding box that covers all time steps. More...
 
BoundingBox::BoundsArrayType GetBoundsInWorld () const
 Returns the world bounds of the object that cover all time steps. More...
 
ScalarType GetExtentInWorld (unsigned int direction) const
 Returns the Extend of the bounding in the given direction. More...
 
void Update ()
 Updates the geometry. More...
 
virtual void UpdateWithoutBoundingBox ()
 Updates everything except the Bounding box. More...
 
void ExecuteOperation (Operation *op) override
 Executes the given operation on all time steps. More...
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::TimeGeometry
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 ~ArbitraryTimeGeometry () override
 
- Protected Member Functions inherited from mitk::TimeGeometry
 TimeGeometry ()
 
 ~TimeGeometry () override
 
LightObject::Pointer InternalClone () const override
 Makes a deep copy of the current object. More...
 

Protected Attributes

std::vector< BaseGeometry::Pointerm_GeometryVector
 
std::vector< TimePointTypem_MinimumTimePoints
 
std::vector< TimePointTypem_MaximumTimePoints
 
- Protected Attributes inherited from mitk::TimeGeometry
BoundingBox::Pointer m_BoundingBox
 Contains a bounding box which includes all time steps. More...
 

Detailed Description

Definition at line 44 of file mitkArbitraryTimeGeometry.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

◆ self

◆ Superclass

Constructor & Destructor Documentation

◆ ArbitraryTimeGeometry()

mitk::ArbitraryTimeGeometry::ArbitraryTimeGeometry ( )
default

◆ ~ArbitraryTimeGeometry()

mitk::ArbitraryTimeGeometry::~ArbitraryTimeGeometry ( )
overrideprotecteddefault

Member Function Documentation

◆ AppendNewTimeStep()

void mitk::ArbitraryTimeGeometry::AppendNewTimeStep ( BaseGeometry geometry,
TimePointType  minimumTimePoint,
TimePointType  maximumTimePoint 
)

Append the passed geometry to the time geometry.

Precondition
The passed geometry pointer must be valid.
The minimumTimePoint must not be smaller than the maximum time point of the currently last time step. Therefore time steps must not be overlapping in time.
minimumTimePoint must not be larger then maximumTimePoint.

Definition at line 240 of file mitkArbitraryTimeGeometry.cpp.

References m_GeometryVector, m_MaximumTimePoints, m_MinimumTimePoints, and mitkThrow.

Referenced by AppendNewTimeStepClone(), and Initialize().

◆ AppendNewTimeStepClone()

void mitk::ArbitraryTimeGeometry::AppendNewTimeStepClone ( const BaseGeometry geometry,
TimePointType  minimumTimePoint,
TimePointType  maximumTimePoint 
)

Same than AppendNewTimeStep. But clones geometry before adding it.

Definition at line 267 of file mitkArbitraryTimeGeometry.cpp.

References AppendNewTimeStep(), clone(), and mitk::BaseGeometry::Clone().

◆ ClearAllGeometries()

void mitk::ArbitraryTimeGeometry::ClearAllGeometries ( )

Definition at line 174 of file mitkArbitraryTimeGeometry.cpp.

References m_GeometryVector, m_MaximumTimePoints, and m_MinimumTimePoints.

Referenced by Initialize().

◆ Clone()

Pointer mitk::ArbitraryTimeGeometry::Clone ( ) const

Referenced by InternalClone().

◆ CountTimeSteps()

mitk::TimeStepType mitk::ArbitraryTimeGeometry::CountTimeSteps ( ) const
overridevirtual

Returns the number of time steps.

Returns the number of time steps for which geometries are saved. The number of time steps is also the upper bound of the time steps. The minimum time steps is always 0.

Implements mitk::TimeGeometry.

Definition at line 34 of file mitkArbitraryTimeGeometry.cpp.

References m_GeometryVector.

Referenced by Expand(), InternalClone(), and IsValidTimeStep().

◆ Expand()

void mitk::ArbitraryTimeGeometry::Expand ( mitk::TimeStepType  size)
overridevirtual

Expands the time geometry to the given number of time steps.

Initializes the new time steps with empty geometries. This default geometries will behave like ProportionalTimeGeometry. Shrinking is not supported. The new steps will have the same duration like the last step before extension.

Implements mitk::TimeGeometry.

Definition at line 188 of file mitkArbitraryTimeGeometry.cpp.

References CountTimeSteps(), GetMaximumTimePoint(), GetMinimumTimePoint(), m_GeometryVector, m_MaximumTimePoints, m_MinimumTimePoints, and mitk::Geometry3D::New().

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::ArbitraryTimeGeometry::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::TimeGeometry.

Definition at line 47 of file mitkArbitraryTimeGeometry.h.

◆ GetClassName()

virtual const char* mitk::ArbitraryTimeGeometry::GetClassName ( ) const
virtual

Reimplemented from mitk::TimeGeometry.

◆ GetGeometryCloneForTimeStep()

mitk::BaseGeometry::Pointer mitk::ArbitraryTimeGeometry::GetGeometryCloneForTimeStep ( TimeStepType  timeStep) const
overridevirtual

Returns the geometry which corresponds to the given time step.

Returns a clone of the geometry which defines the given time step. If the given time step is invalid an null-pointer is returned.

Implements mitk::TimeGeometry.

Definition at line 160 of file mitkArbitraryTimeGeometry.cpp.

References m_GeometryVector.

◆ GetGeometryForTimePoint()

mitk::BaseGeometry::Pointer mitk::ArbitraryTimeGeometry::GetGeometryForTimePoint ( TimePointType  timePoint) const
overridevirtual

Returns the geometry which corresponds to the given time point.

Returns the geometry which defines the given time point. If the given time point is invalid an null-pointer is returned.

If the returned geometry is changed this will affect the saved geometry.

Implements mitk::TimeGeometry.

Definition at line 146 of file mitkArbitraryTimeGeometry.cpp.

References GetGeometryForTimeStep(), IsValidTimePoint(), and TimePointToTimeStep().

◆ GetGeometryForTimeStep()

mitk::BaseGeometry::Pointer mitk::ArbitraryTimeGeometry::GetGeometryForTimeStep ( TimeStepType  timeStep) const
overridevirtual

Returns the geometry which corresponds to the given time step.

Returns the geometry which defines the given time step. If the given time step is invalid an null-pointer is returned.

If the returned geometry is changed this will affect the saved geometry.

Implements mitk::TimeGeometry.

Definition at line 133 of file mitkArbitraryTimeGeometry.cpp.

References IsValidTimeStep(), and m_GeometryVector.

Referenced by GetGeometryForTimePoint().

◆ GetMaximumTimePoint() [1/2]

mitk::TimePointType mitk::ArbitraryTimeGeometry::GetMaximumTimePoint ( ) const
overridevirtual

Returns the last time point for which the time geometry instance is valid.

Gives the last time point for which a valid geometry is saved in this time geometry. It is the upper time bound of the last step. The time point is given in ms.

Implements mitk::TimeGeometry.

Definition at line 44 of file mitkArbitraryTimeGeometry.cpp.

References m_MaximumTimePoints.

Referenced by Expand(), GetTimeBounds(), IsValidTimePoint(), and PrintSelf().

◆ GetMaximumTimePoint() [2/2]

mitk::TimePointType mitk::ArbitraryTimeGeometry::GetMaximumTimePoint ( TimeStepType  step) const
overridevirtual

Returns the last time point for which the time geometry instance is valid.

Gives the last time point for the Geometry specified by the given TimeStep. The time point is given in ms.

Implements mitk::TimeGeometry.

Definition at line 64 of file mitkArbitraryTimeGeometry.cpp.

References m_MaximumTimePoints.

◆ GetMinimumTimePoint() [1/2]

mitk::TimePointType mitk::ArbitraryTimeGeometry::GetMinimumTimePoint ( ) const
overridevirtual

Returns the first time point for which the time geometry instance is valid.

Returns the first valid time point for this geometry. It is the lower time bound of the first step. The time point is given in ms.

Implements mitk::TimeGeometry.

Definition at line 39 of file mitkArbitraryTimeGeometry.cpp.

References m_MinimumTimePoints.

Referenced by Expand(), GetMinimumTimePoint(), GetTimeBounds(), IsValidTimePoint(), PrintSelf(), and TimePointToTimeStep().

◆ GetMinimumTimePoint() [2/2]

mitk::TimePointType mitk::ArbitraryTimeGeometry::GetMinimumTimePoint ( TimeStepType  step) const
overridevirtual

Returns the first time point for which the time geometry instance is valid.

Returns the first valid time point for the given TimeStep. The time point is given in ms.

Implements mitk::TimeGeometry.

Definition at line 54 of file mitkArbitraryTimeGeometry.cpp.

References GetMinimumTimePoint(), and m_MaximumTimePoints.

◆ GetStaticNameOfClass()

static const char* mitk::ArbitraryTimeGeometry::GetStaticNameOfClass ( )
inlinestatic

◆ GetTimeBounds() [1/2]

mitk::TimeBounds mitk::ArbitraryTimeGeometry::GetTimeBounds ( ) const
overridevirtual

Get the time bounds (in ms) it returns GetMinimumTimePoint() and GetMaximumTimePoint() results as bounds.

Implements mitk::TimeGeometry.

Definition at line 74 of file mitkArbitraryTimeGeometry.cpp.

References GetMaximumTimePoint(), and GetMinimumTimePoint().

◆ GetTimeBounds() [2/2]

mitk::TimeBounds mitk::ArbitraryTimeGeometry::GetTimeBounds ( TimeStepType  step) const
overridevirtual

Get the time bounds for the given TimeStep (in ms)

Implements mitk::TimeGeometry.

Definition at line 82 of file mitkArbitraryTimeGeometry.cpp.

References GetMaximumTimePoint(), and GetMinimumTimePoint().

◆ HasCollapsedFinalTimeStep()

bool mitk::ArbitraryTimeGeometry::HasCollapsedFinalTimeStep ( ) const

This is a helper that indicates problematic corner cases that often occure e.g. when loading dynamic DICOM data. There the final time step is collapsed as min time bound and max time bound have the same value. For a more detailed explanation why it happens please see: https://phabricator.mitk.org/T24766#131411 and https://phabricator.mitk.org/T27259#203524

Definition at line 297 of file mitkArbitraryTimeGeometry.cpp.

References m_MaximumTimePoints, and m_MinimumTimePoints.

Referenced by IsValidTimePoint(), and TimePointToTimeStep().

◆ Initialize()

void mitk::ArbitraryTimeGeometry::Initialize ( )
overridevirtual

Initializes a new object with one time steps which contains an empty geometry.

Reimplemented from mitk::TimeGeometry.

Definition at line 23 of file mitkArbitraryTimeGeometry.cpp.

References AppendNewTimeStep(), ClearAllGeometries(), mitk::Geometry3D::New(), and mitk::TimeGeometry::Update().

◆ InternalClone()

itk::LightObject::Pointer mitk::ArbitraryTimeGeometry::InternalClone ( ) const
override

Makes a deep copy of the current object.

Definition at line 226 of file mitkArbitraryTimeGeometry.cpp.

References Clone(), CountTimeSteps(), mitk::TimeGeometry::InternalClone(), m_GeometryVector, m_MaximumTimePoints, and m_MinimumTimePoints.

◆ IsValid()

bool mitk::ArbitraryTimeGeometry::IsValid ( ) const
overridevirtual

Tests if all necessary informations are set and the object is valid.

Implements mitk::TimeGeometry.

Definition at line 167 of file mitkArbitraryTimeGeometry.cpp.

References m_GeometryVector.

◆ IsValidTimePoint()

bool mitk::ArbitraryTimeGeometry::IsValidTimePoint ( TimePointType  timePoint) const
overridevirtual

Tests if a given time point is covered by this time geometry instance.

Returns true if a geometry can be returned for the given time point (so it is within GetTimeBounds() and fails if not. The time point must be given in ms.

Implements mitk::TimeGeometry.

Definition at line 90 of file mitkArbitraryTimeGeometry.cpp.

References GetMaximumTimePoint(), GetMinimumTimePoint(), and HasCollapsedFinalTimeStep().

Referenced by GetGeometryForTimePoint().

◆ IsValidTimeStep()

bool mitk::ArbitraryTimeGeometry::IsValidTimeStep ( TimeStepType  timeStep) const
overridevirtual

Test for the given time step if a geometry is availible.

Returns true if a geometry is defined for the given time step. Otherwise false is returned. The time step is defined as positiv number.

Implements mitk::TimeGeometry.

Definition at line 96 of file mitkArbitraryTimeGeometry.cpp.

References CountTimeSteps().

Referenced by GetGeometryForTimeStep().

◆ New()

◆ PrintSelf()

void mitk::ArbitraryTimeGeometry::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
override

◆ ReplaceTimeStepGeometries()

void mitk::ArbitraryTimeGeometry::ReplaceTimeStepGeometries ( const BaseGeometry geometry)
overridevirtual

Replaces the geometry instances with clones of the passed geometry.

Replaces the geometries of all time steps with clones of the passed geometry. Replacement strategy depends on the implementation of TimeGeometry sub class.

Remarks
The time points itself stays untouched. Use this method if you want to change the spatial properties of a TimeGeometry and preserve the time "grid".

Implements mitk::TimeGeometry.

Definition at line 206 of file mitkArbitraryTimeGeometry.cpp.

References mitk::BaseGeometry::Clone(), and m_GeometryVector.

◆ ReserveSpaceForGeometries()

void mitk::ArbitraryTimeGeometry::ReserveSpaceForGeometries ( TimeStepType  numberOfGeometries)

◆ SetTimeStepGeometry()

void mitk::ArbitraryTimeGeometry::SetTimeStepGeometry ( BaseGeometry geometry,
TimeStepType  timeStep 
)
overridevirtual

Sets the geometry for the given time step.

If passed time step is not valid. Nothing will be changed.

Precondition
geometry must point to a valid instance.

Implements mitk::TimeGeometry.

Definition at line 214 of file mitkArbitraryTimeGeometry.cpp.

References m_GeometryVector.

◆ TimePointToTimeStep()

mitk::TimeStepType mitk::ArbitraryTimeGeometry::TimePointToTimeStep ( TimePointType  timePoint) const
overridevirtual

Converts a time point to the corresponding time step.

Converts a time point to a time step in a way that the new time step indicates the same geometry as the time point. The associated time step is the last step which lower time bound is smaller or equal then the time point. If a negative invalid time point is given always time step 0 is returned. If a positive invalid time point is given the last time step will be returned. This is also true for time points that are exactly on the upper time bound (the only exception is the final time step in case that HasCollapsedFinalTimeStep() is true).

Implements mitk::TimeGeometry.

Definition at line 113 of file mitkArbitraryTimeGeometry.cpp.

References GetMinimumTimePoint(), HasCollapsedFinalTimeStep(), and m_MaximumTimePoints.

Referenced by GetGeometryForTimePoint().

◆ TimeStepToTimePoint()

mitk::TimePointType mitk::ArbitraryTimeGeometry::TimeStepToTimePoint ( TimeStepType  timeStep) const
overridevirtual

Converts a time step to a time point.

Converts a time step to a time point by using the time steps lower time bound. If the original time steps does not point to a valid geometry, a time point is calculated that also does not point to a valid geometry, but no exception is raised.

Implements mitk::TimeGeometry.

Definition at line 101 of file mitkArbitraryTimeGeometry.cpp.

References m_MinimumTimePoints.

Member Data Documentation

◆ m_GeometryVector

◆ m_MaximumTimePoints

◆ m_MinimumTimePoints


The documentation for this class was generated from the following files: