|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Encapsulates a single (possibly time-resolved) ROI. More...
#include <mitkROI.h>


Public Types | |
| using | PointsType = std::map< TimeStepType, Point3D > |
| Map from time steps to 3D points (used for min/max corners). More... | |
| using | PropertyListsType = std::map< TimeStepType, PropertyList::Pointer > |
| Map from time steps to property lists. More... | |
Public Member Functions | |
| Element () | |
| Default constructor. Initializes the element with ID 0. More... | |
| Element (unsigned int id) | |
| Construct an element with the given unique ID. More... | |
| Element (const Element &other) | |
| Copy constructor. Deep-copies all properties. More... | |
| Element & | operator= (Element other) |
| Copy-and-swap assignment operator. More... | |
| ~Element ()=default | |
| BaseProperty::ConstPointer | GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override |
| Get a const property by key and optional context. More... | |
| BaseProperty::ConstPointer | GetConstProperty (const std::string &propertyKey, TimeStepType t, bool fallBackOnDefaultContext=true) const |
| Get a const property by key and time step. More... | |
| std::vector< std::string > | GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override |
| Get all property keys for a given context. More... | |
| std::vector< std::string > | GetPropertyKeys (TimeStepType t, bool includeDefaultContext=false) const |
| Get all property keys for a given time step. More... | |
| std::vector< std::string > | GetPropertyContextNames () const override |
| Get all property context names (stringified time steps). More... | |
| BaseProperty * | GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override |
| Get a mutable property by key and optional context. More... | |
| BaseProperty * | GetNonConstProperty (const std::string &propertyKey, TimeStepType t, bool fallBackOnDefaultContext=true) |
| Get a mutable property by key and time step. More... | |
| void | SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
| Set a property for a given context. More... | |
| void | SetProperty (const std::string &propertyKey, BaseProperty *property, TimeStepType t, bool fallBackOnDefaultContext=false) |
| Set a property at a specific time step. More... | |
| void | RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
| Remove a property from a given context. More... | |
| void | RemoveProperty (const std::string &propertyKey, TimeStepType t, bool fallBackOnDefaultContext=false) |
| Remove a property at a specific time step. More... | |
| unsigned int | GetID () const |
| Get the unique ID of this ROI element. More... | |
| void | SetID (unsigned int id) |
| Set the unique ID of this ROI element. More... | |
| bool | HasTimeStep (TimeStepType t) const |
| Check if the ROI is defined for a certain time step. More... | |
| bool | HasTimeSteps () const |
| Check if the ROI can be considered time-resolved. More... | |
| std::vector< TimeStepType > | GetTimeSteps () const |
| Get all valid time steps that have a minimum point and a maximum point. More... | |
| Point3D | GetMin (TimeStepType t=0) const |
| Get the minimum corner point of the axis-aligned bounding box. More... | |
| void | SetMin (const Point3D &min, TimeStepType t=0) |
| Set the minimum corner point of the axis-aligned bounding box. More... | |
| Point3D | GetMax (TimeStepType t=0) const |
| Get the maximum corner point of the axis-aligned bounding box. More... | |
| void | SetMax (const Point3D &max, TimeStepType t=0) |
| Set the maximum corner point of the axis-aligned bounding box. More... | |
| PropertyList * | GetDefaultProperties () const |
| Get the default (time-step-independent) property list. More... | |
| void | SetDefaultProperties (PropertyList *properties) |
| Set the default property list. More... | |
| PropertyList * | GetProperties (TimeStepType t=0) const |
Get properties for a certain time step or nullptr if absent. More... | |
| void | SetProperties (PropertyList *properties, TimeStepType t=0) |
| Set the property list for a specific time step. More... | |
Public Member Functions inherited from mitk::IPropertyOwner | |
| ~IPropertyOwner () override | |
| virtual bool | PropertyIsOwned (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const |
| Checks if a certain property exists. More... | |
Public Member Functions inherited from mitk::IPropertyProvider | |
| virtual | ~IPropertyProvider () |
| Virtual destructor. More... | |
Encapsulates a single (possibly time-resolved) ROI.
| using mitk::ROI::Element::PointsType = std::map<TimeStepType, Point3D> |
| using mitk::ROI::Element::PropertyListsType = std::map<TimeStepType, PropertyList::Pointer> |
| mitk::ROI::Element::Element | ( | ) |
Default constructor. Initializes the element with ID 0.
|
explicit |
Construct an element with the given unique ID.
| [in] | id | The unique identifier for this ROI element. |
| mitk::ROI::Element::Element | ( | const Element & | other | ) |
Copy constructor. Deep-copies all properties.
| [in] | other | The element to copy from. |
|
default |
|
overridevirtual |
Get a const property by key and optional context.
| [in] | propertyKey | The key of the property to retrieve. |
| [in] | contextName | The context (stringified time step) to look up. An empty string addresses the default properties. |
| [in] | fallBackOnDefaultContext | If true and the property is not found in the specified context, fall back to the default properties. |
nullptr if not found.std::to_string() to convert a time step to a context name. Implements mitk::IPropertyProvider.
Referenced by mitk::ROIMapperHelper::GetConstProperty().
| BaseProperty::ConstPointer mitk::ROI::Element::GetConstProperty | ( | const std::string & | propertyKey, |
| TimeStepType | t, | ||
| bool | fallBackOnDefaultContext = true |
||
| ) | const |
Get a const property by key and time step.
| [in] | propertyKey | The key of the property to retrieve. |
| [in] | t | The time step to look up. |
| [in] | fallBackOnDefaultContext | If true and the property is not found at time step t, fall back to the default properties. |
nullptr if not found. | PropertyList* mitk::ROI::Element::GetDefaultProperties | ( | ) | const |
Get the default (time-step-independent) property list.
nullptr. | unsigned int mitk::ROI::Element::GetID | ( | ) | const |
Get the unique ID of this ROI element.
| Point3D mitk::ROI::Element::GetMax | ( | TimeStepType | t = 0 | ) | const |
Get the maximum corner point of the axis-aligned bounding box.
| [in] | t | The time step to query (default: 0). |
| std::out_of_range | if the time step does not exist. |
| Point3D mitk::ROI::Element::GetMin | ( | TimeStepType | t = 0 | ) | const |
Get the minimum corner point of the axis-aligned bounding box.
| [in] | t | The time step to query (default: 0). |
| std::out_of_range | if the time step does not exist. |
|
overridevirtual |
Get a mutable property by key and optional context.
| [in] | propertyKey | The key of the property to retrieve. |
| [in] | contextName | The context (stringified time step) to look up. An empty string addresses the default properties. |
| [in] | fallBackOnDefaultContext | If true and the property is not found in the specified context, fall back to the default properties. |
nullptr if not found.std::to_string() to convert a time step to a context name. Implements mitk::IPropertyOwner.
| BaseProperty* mitk::ROI::Element::GetNonConstProperty | ( | const std::string & | propertyKey, |
| TimeStepType | t, | ||
| bool | fallBackOnDefaultContext = true |
||
| ) |
Get a mutable property by key and time step.
| [in] | propertyKey | The key of the property to retrieve. |
| [in] | t | The time step to look up. |
| [in] | fallBackOnDefaultContext | If true and the property is not found at time step t, fall back to the default properties. |
nullptr if not found. | PropertyList* mitk::ROI::Element::GetProperties | ( | TimeStepType | t = 0 | ) | const |
Get properties for a certain time step or nullptr if absent.
|
overridevirtual |
Get all property context names (stringified time steps).
Implements mitk::IPropertyProvider.
|
overridevirtual |
Get all property keys for a given context.
| [in] | contextName | The context (stringified time step) to query. An empty string addresses the default properties. |
| [in] | includeDefaultContext | If true, also include keys from the default properties. |
std::to_string() to convert a time step to a context name. Implements mitk::IPropertyProvider.
| std::vector<std::string> mitk::ROI::Element::GetPropertyKeys | ( | TimeStepType | t, |
| bool | includeDefaultContext = false |
||
| ) | const |
Get all property keys for a given time step.
| [in] | t | The time step to query. |
| [in] | includeDefaultContext | If true, also include keys from the default properties that are not already present at time step t. |
| std::vector<TimeStepType> mitk::ROI::Element::GetTimeSteps | ( | ) | const |
Get all valid time steps that have a minimum point and a maximum point.
| bool mitk::ROI::Element::HasTimeStep | ( | TimeStepType | t | ) | const |
Check if the ROI is defined for a certain time step.
| bool mitk::ROI::Element::HasTimeSteps | ( | ) | const |
Check if the ROI can be considered time-resolved.
Copy-and-swap assignment operator.
| [in] | other | The element to assign from (passed by value for copy-and-swap). |
|
overridevirtual |
Remove a property from a given context.
| [in] | propertyKey | The key of the property to remove. |
| [in] | contextName | The context (stringified time step) to remove the property from. An empty string addresses the default properties. |
| [in] | fallBackOnDefaultContext | If true and the specified context does not exist, remove the property from the default properties instead. |
std::to_string() to convert a time step to a context name. Implements mitk::IPropertyOwner.
| void mitk::ROI::Element::RemoveProperty | ( | const std::string & | propertyKey, |
| TimeStepType | t, | ||
| bool | fallBackOnDefaultContext = false |
||
| ) |
Remove a property at a specific time step.
| [in] | propertyKey | The key of the property to remove. |
| [in] | t | The time step from which to remove the property. |
| [in] | fallBackOnDefaultContext | If true and the time step does not exist, remove the property from the default properties. If false and the time step does not exist, an exception is thrown. |
| mitk::Exception | if fallBackOnDefaultContext is false and the time step does not exist. |
| void mitk::ROI::Element::SetDefaultProperties | ( | PropertyList * | properties | ) |
Set the default property list.
| [in] | properties | The property list to use as defaults. If nullptr, a new empty property list is created. |
| void mitk::ROI::Element::SetID | ( | unsigned int | id | ) |
| void mitk::ROI::Element::SetMax | ( | const Point3D & | max, |
| TimeStepType | t = 0 |
||
| ) |
Set the maximum corner point of the axis-aligned bounding box.
| [in] | max | The maximum corner point in index coordinates. |
| [in] | t | The time step to set (default: 0). |
| void mitk::ROI::Element::SetMin | ( | const Point3D & | min, |
| TimeStepType | t = 0 |
||
| ) |
Set the minimum corner point of the axis-aligned bounding box.
| [in] | min | The minimum corner point in index coordinates. |
| [in] | t | The time step to set (default: 0). |
| void mitk::ROI::Element::SetProperties | ( | PropertyList * | properties, |
| TimeStepType | t = 0 |
||
| ) |
Set the property list for a specific time step.
| [in] | properties | The property list to assign. |
| [in] | t | The time step to associate the properties with (default: 0). |
|
overridevirtual |
Set a property for a given context.
| [in] | propertyKey | The key of the property to set. |
| [in] | property | The property value to assign. |
| [in] | contextName | The context (stringified time step) to set the property in. An empty string addresses the default properties. |
| [in] | fallBackOnDefaultContext | If true and the specified context does not exist, set the property in the default properties instead. |
std::to_string() to convert a time step to a context name. Implements mitk::IPropertyOwner.
| void mitk::ROI::Element::SetProperty | ( | const std::string & | propertyKey, |
| BaseProperty * | property, | ||
| TimeStepType | t, | ||
| bool | fallBackOnDefaultContext = false |
||
| ) |
Set a property at a specific time step.
| [in] | propertyKey | The key of the property to set. |
| [in] | property | The property value to assign. |
| [in] | t | The time step at which to set the property. |
| [in] | fallBackOnDefaultContext | If true and the time step does not exist, set the property in the default properties. If false and the time step does not exist, an exception is thrown. |
| mitk::Exception | if fallBackOnDefaultContext is false and the time step does not exist. |