|
Medical Imaging Interaction Toolkit
2025.12.02
Medical Imaging Interaction Toolkit
|
A data structure describing a label. More...
#include <mitkLabel.h>


Public Types | |
| enum class | AlgorithmType { Undefined , MANUAL , SEMIAUTOMATIC , AUTOMATIC } |
| typedef unsigned short | PixelType |
Public Types inherited from mitk::PropertyList | |
| typedef std::map< std::string, BaseProperty::Pointer > | PropertyMap |
| typedef std::pair< std::string, BaseProperty::Pointer > | PropertyMapElementType |
Public Member Functions | |
| mitkClassMacro (Label, mitk::PropertyList) | |
| mitkNewMacro2Param (Self, PixelType, const std::string &) | |
| void | SetLocked (bool locked) |
| bool | GetLocked () const |
| void | SetVisible (bool visible) |
| bool | GetVisible () const |
| void | SetOpacity (float opacity) |
| float | GetOpacity () const |
| void | SetName (const std::string &name) |
| std::string | GetName () const |
| void | SetTrackingID (const std::string &trackingID) |
| std::string | GetTrackingID () const |
| void | SetTrackingUID (const std::string &trackingUID) |
| std::string | GetTrackingUID () const |
| void | SetDescription (const std::string &description) |
| std::string | GetDescription () const |
| mitk::Point3D | GetCenterOfMassIndex () const |
| mitk::Point3D | GetCenterOfMassCoordinates () const |
| void | ResetCenterOfMass () |
| itk::ModifiedTimeType | GetCenterOfMassMTime () const |
| void | UpdateCenterOfMass (const mitk::Point3D &index, const mitk::Point3D &coordinates) |
| void | SetColor (const mitk::Color &) |
| const mitk::Color & | GetColor () const |
| void | SetValue (PixelType pixelValue) |
| PixelType | GetValue () const |
| void | SetAlgorithmType (AlgorithmType algoType) |
| void | SetAlgorithmTypeStr (const std::string &algoType) |
| AlgorithmType | GetAlgorithmType () const |
| std::string | GetAlgorithmTypeStr () const |
| void | SetAlgorithmName (const std::string &algoName) |
| std::string | GetAlgorithmName () const |
| void | AddToolUse (AlgorithmType algoType, const std::string &algoName) |
| Helper function to add the usage of multiple tools correctly to the label. Mixture of types always lead to semiautomatic. If the algorithm name is empty, the name will directly set. If it is not empty and algoName is not already a sub string of the current algorithm name, the new algoName will be appended (separated by "|"). More... | |
| void | SetAnatomicRegion (const DICOMCodeSequenceWithModifiers &code, std::size_t index=0) |
| Sets an anatomic region code at the specified index. More... | |
| DICOMCodeSequenceWithModifiers | GetAnatomicRegion (std::size_t index=0) const |
| Gets an anatomic region code at the specified index. More... | |
| std::size_t | GetAnatomicRegionCount () const |
| Gets the number of anatomic region codes stored. More... | |
| void | RemoveAnatomicRegion (std::size_t index) |
| Removes an anatomic region code at the specified index. More... | |
| void | SetPrimaryAnatomicStructure (const DICOMCodeSequenceWithModifiers &code, std::size_t index=0) |
| Sets a primary anatomic structure code at the specified index. More... | |
| DICOMCodeSequenceWithModifiers | GetPrimaryAnatomicStructure (std::size_t index=0) const |
| Gets a primary anatomic structure code at the specified index. More... | |
| std::size_t | GetPrimaryAnatomicStructureCount () const |
| Gets the number of primary anatomic structure codes stored. More... | |
| void | RemovePrimaryAnatomicStructure (std::size_t index) |
| Removes a primary anatomic structure code at the specified index. More... | |
| void | SetSegmentedPropertyCategory (const DICOMCodeSequence &code) |
| Sets the segmented property category code. More... | |
| std::optional< DICOMCodeSequence > | GetSegmentedPropertyCategory () const |
| Gets the segmented property category code. More... | |
| void | SetSegmentedPropertyType (const DICOMCodeSequenceWithModifiers &code) |
| Sets the segmented property type code with optional modifiers. More... | |
| std::optional< DICOMCodeSequenceWithModifiers > | GetSegmentedPropertyType () const |
| Gets the segmented property type code with modifiers. More... | |
| void | SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
| Add new or change existent property. More... | |
| BaseProperty::ConstPointer | GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override |
| Get property by its key. More... | |
| BaseProperty * | GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override |
| Get property by its key. More... | |
| void | Modified () |
| void | Update (const Label *templateLabel, bool updateLabelValue=false) |
| Function updates the property values of a label provided as templates. If a property exists in the destination label only the value will be updated (therefor observers and pointers stay valid). If the property does not exist, it will be cloned and added. No properties will be removed. More... | |
| Label () | |
| Label (PixelType value, const std::string &name) | |
| ~Label () override | |
Public Member Functions inherited from mitk::PropertyList | |
| mitkClassMacroItkParent (PropertyList, itk::Object) | |
| Pointer | Clone () const |
| std::vector< std::string > | GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override |
| Query keys of existing properties. More... | |
| std::vector< std::string > | GetPropertyContextNames () const override |
| Query names of existing contexts. More... | |
| void | RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
| Removes a property. If the property does not exist, nothing will be done. More... | |
| mitk::BaseProperty * | GetProperty (const std::string &propertyKey) const |
| Get a property by its name. More... | |
| void | ReplaceProperty (const std::string &propertyKey, BaseProperty *property) |
| Set a property object in the list/map by reference. More... | |
| void | ConcatenatePropertyList (PropertyList *pList, bool replace=false) |
| Set a property object in the list/map by reference. More... | |
| template<typename T > | |
| bool | GetPropertyValue (const char *propertyKey, T &value) const |
| Convenience access method for GenericProperty<T> properties (T being the type of the second parameter) More... | |
| bool | GetBoolProperty (const char *propertyKey, bool &boolValue) const |
| Convenience method to access the value of a BoolProperty. More... | |
| bool | Get (const char *propertyKey, bool &boolValue) const |
| ShortCut for the above method. More... | |
| void | SetBoolProperty (const char *propertyKey, bool boolValue) |
| Convenience method to set the value of a BoolProperty. More... | |
| void | Set (const char *propertyKey, bool boolValue) |
| ShortCut for the above method. More... | |
| bool | GetIntProperty (const char *propertyKey, int &intValue) const |
| Convenience method to access the value of an IntProperty. More... | |
| bool | Get (const char *propertyKey, int &intValue) const |
| ShortCut for the above method. More... | |
| void | SetIntProperty (const char *propertyKey, int intValue) |
| Convenience method to set the value of an IntProperty. More... | |
| void | Set (const char *propertyKey, int intValue) |
| ShortCut for the above method. More... | |
| bool | GetFloatProperty (const char *propertyKey, float &floatValue) const |
| Convenience method to access the value of a FloatProperty. More... | |
| bool | Get (const char *propertyKey, float &floatValue) const |
| ShortCut for the above method. More... | |
| void | SetFloatProperty (const char *propertyKey, float floatValue) |
| Convenience method to set the value of a FloatProperty. More... | |
| void | Set (const char *propertyKey, float floatValue) |
| ShortCut for the above method. More... | |
| bool | GetDoubleProperty (const char *propertyKey, double &doubleValue) const |
| Convenience method to access the value of a DoubleProperty. More... | |
| bool | Get (const char *propertyKey, double &doubleValue) const |
| ShortCut for the above method. More... | |
| void | SetDoubleProperty (const char *propertyKey, double doubleValue) |
| Convenience method to set the value of a DoubleProperty. More... | |
| void | Set (const char *propertyKey, double doubleValue) |
| ShortCut for the above method. More... | |
| bool | GetStringProperty (const char *propertyKey, std::string &stringValue) const |
| Convenience method to access the value of a StringProperty. More... | |
| bool | Get (const char *propertyKey, std::string &stringValue) const |
| ShortCut for the above method. More... | |
| void | SetStringProperty (const char *propertyKey, const char *stringValue) |
| Convenience method to set the value of a StringProperty. More... | |
| void | Set (const char *propertyKey, const char *stringValue) |
| ShortCut for the above method. More... | |
| void | Set (const char *propertyKey, const std::string &stringValue) |
| ShortCut for the above method. More... | |
| itk::ModifiedTimeType | GetMTime () const override |
| Get the timestamp of the last change of the map or the last change of one of the properties store in the list (whichever is later). More... | |
| bool | DeleteProperty (const std::string &propertyKey) |
| Remove a property from the list/map. More... | |
| const PropertyMap * | GetMap () const |
| bool | IsEmpty () const |
| virtual void | Clear () |
| void | ToJSON (nlohmann::json &j) const |
| Serialize the property list to JSON. More... | |
| void | FromJSON (const nlohmann::json &j) |
| Deserialize the property list from JSON. 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 () |
Static Public Member Functions | |
| static Pointer | New () |
Static Public Member Functions inherited from mitk::PropertyList | |
| static Pointer | New () |
Static Public Attributes | |
| static const PixelType | MAX_LABEL_VALUE |
| The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535. More... | |
| static constexpr PixelType | UNLABELED_VALUE |
Protected Member Functions | |
| void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
| Label (const Label &other) | |
| void | SetCenterOfMassIndex (const mitk::Point3D ¢er) |
| void | SetCenterOfMassCoordinates (const mitk::Point3D ¢er) |
| mitk::BaseProperty * | GetProperty (const std::string &propertyKey) const |
| Get a property by its name. More... | |
Protected Member Functions inherited from mitk::PropertyList | |
| PropertyList () | |
| PropertyList (const PropertyList &other) | |
| ~PropertyList () override | |
Additional Inherited Members | |
Protected Attributes inherited from mitk::PropertyList | |
| PropertyMap | m_Properties |
| Map of properties. More... | |
A data structure describing a label.
Definition at line 89 of file mitkLabel.h.
| typedef unsigned short mitk::Label::PixelType |
Definition at line 94 of file mitkLabel.h.
|
strong |
| Enumerator | |
|---|---|
| Undefined | undefined type |
| MANUAL | user generated labels with simple tooling (e.g. Add tool) |
| SEMIAUTOMATIC | calculated label by user with algorithmic assistance (e.g. nnInteractive) |
| AUTOMATIC | fully automatically generated by an algorithm (e.g. nnUnet) |
Definition at line 140 of file mitkLabel.h.
| mitk::Label::Label | ( | ) |
| mitk::Label::Label | ( | PixelType | value, |
| const std::string & | name | ||
| ) |
|
override |
|
protected |
| void mitk::Label::AddToolUse | ( | AlgorithmType | algoType, |
| const std::string & | algoName | ||
| ) |
Helper function to add the usage of multiple tools correctly to the label. Mixture of types always lead to semiautomatic. If the algorithm name is empty, the name will directly set. If it is not empty and algoName is not already a sub string of the current algorithm name, the new algoName will be appended (separated by "|").
| std::string mitk::Label::GetAlgorithmName | ( | ) | const |
| AlgorithmType mitk::Label::GetAlgorithmType | ( | ) | const |
| std::string mitk::Label::GetAlgorithmTypeStr | ( | ) | const |
| DICOMCodeSequenceWithModifiers mitk::Label::GetAnatomicRegion | ( | std::size_t | index = 0 | ) | const |
Gets an anatomic region code at the specified index.
| index | The index of the code to retrieve (default: 0) |
| std::size_t mitk::Label::GetAnatomicRegionCount | ( | ) | const |
Gets the number of anatomic region codes stored.
| mitk::Point3D mitk::Label::GetCenterOfMassCoordinates | ( | ) | const |
| mitk::Point3D mitk::Label::GetCenterOfMassIndex | ( | ) | const |
| itk::ModifiedTimeType mitk::Label::GetCenterOfMassMTime | ( | ) | const |
| const mitk::Color& mitk::Label::GetColor | ( | ) | const |
|
overridevirtual |
Get property by its key.
| [in] | propertyKey | Key of property. |
| [in] | contextName | Optional, default is empty string (default context). Search in specified context. |
| [in] | fallBackOnDefaultContext | Optional, default is true. Also search in default context if property was not found in given context. |
Reimplemented from mitk::PropertyList.
| std::string mitk::Label::GetDescription | ( | ) | const |
| bool mitk::Label::GetLocked | ( | ) | const |
| std::string mitk::Label::GetName | ( | ) | const |
|
overridevirtual |
Get property by its key.
| [in] | propertyKey | Key of property. |
| [in] | contextName | Optional, default is empty string (default context). Search in specified context. |
| [in] | fallBackOnDefaultContext | Optional, default is true. Also search in default context if property was not found in given context. |
Reimplemented from mitk::PropertyList.
| float mitk::Label::GetOpacity | ( | ) | const |
| DICOMCodeSequenceWithModifiers mitk::Label::GetPrimaryAnatomicStructure | ( | std::size_t | index = 0 | ) | const |
Gets a primary anatomic structure code at the specified index.
| index | The index of the code to retrieve (default: 0) |
| std::size_t mitk::Label::GetPrimaryAnatomicStructureCount | ( | ) | const |
Gets the number of primary anatomic structure codes stored.
|
protected |
Get a property by its name.
| std::optional<DICOMCodeSequence> mitk::Label::GetSegmentedPropertyCategory | ( | ) | const |
Gets the segmented property category code.
| std::optional<DICOMCodeSequenceWithModifiers> mitk::Label::GetSegmentedPropertyType | ( | ) | const |
Gets the segmented property type code with modifiers.
| std::string mitk::Label::GetTrackingID | ( | ) | const |
| std::string mitk::Label::GetTrackingUID | ( | ) | const |
| PixelType mitk::Label::GetValue | ( | ) | const |
| bool mitk::Label::GetVisible | ( | ) | const |
| mitk::Label::mitkClassMacro | ( | Label | , |
| mitk::PropertyList | |||
| ) |
| mitk::Label::mitkNewMacro2Param | ( | Self | , |
| PixelType | , | ||
| const std::string & | |||
| ) |
|
inline |
Definition at line 247 of file mitkLabel.h.
|
static |
|
overrideprotected |
| void mitk::Label::RemoveAnatomicRegion | ( | std::size_t | index | ) |
Removes an anatomic region code at the specified index.
| index | The index of the code to remove |
| void mitk::Label::RemovePrimaryAnatomicStructure | ( | std::size_t | index | ) |
Removes a primary anatomic structure code at the specified index.
| index | The index of the code to remove |
| void mitk::Label::ResetCenterOfMass | ( | ) |
| void mitk::Label::SetAlgorithmName | ( | const std::string & | algoName | ) |
| void mitk::Label::SetAlgorithmType | ( | AlgorithmType | algoType | ) |
| void mitk::Label::SetAlgorithmTypeStr | ( | const std::string & | algoType | ) |
| void mitk::Label::SetAnatomicRegion | ( | const DICOMCodeSequenceWithModifiers & | code, |
| std::size_t | index = 0 |
||
| ) |
Sets an anatomic region code at the specified index.
| code | The DICOMCodeSequenceWithModifiers representing the anatomic region |
| index | The index at which to store the code (default: 0) |
|
protected |
|
protected |
| void mitk::Label::SetColor | ( | const mitk::Color & | ) |
| void mitk::Label::SetDescription | ( | const std::string & | description | ) |
| void mitk::Label::SetLocked | ( | bool | locked | ) |
| void mitk::Label::SetName | ( | const std::string & | name | ) |
| void mitk::Label::SetOpacity | ( | float | opacity | ) |
| void mitk::Label::SetPrimaryAnatomicStructure | ( | const DICOMCodeSequenceWithModifiers & | code, |
| std::size_t | index = 0 |
||
| ) |
Sets a primary anatomic structure code at the specified index.
| code | The DICOMCodeSequenceWithModifiers representing the primary anatomic structure |
| index | The index at which to store the code (default: 0) |
|
overridevirtual |
Add new or change existent property.
| [in] | propertyKey | Key of property. |
| [in] | property | The actual property. |
| [in] | contextName | Optional, default is empty string (default context). Context in which the property is set. |
| [in] | fallBackOnDefaultContext | Optional, default is false. Set property in default context if given context does not exist. |
Reimplemented from mitk::PropertyList.
| void mitk::Label::SetSegmentedPropertyCategory | ( | const DICOMCodeSequence & | code | ) |
Sets the segmented property category code.
| code | The DICOMCodeSequence representing the segmented property category |
| void mitk::Label::SetSegmentedPropertyType | ( | const DICOMCodeSequenceWithModifiers & | code | ) |
Sets the segmented property type code with optional modifiers.
| code | The DICOMCodeSequenceWithModifiers representing the segmented property type |
| void mitk::Label::SetTrackingID | ( | const std::string & | trackingID | ) |
| void mitk::Label::SetTrackingUID | ( | const std::string & | trackingUID | ) |
| void mitk::Label::SetValue | ( | PixelType | pixelValue | ) |
| void mitk::Label::SetVisible | ( | bool | visible | ) |
| void mitk::Label::Update | ( | const Label * | templateLabel, |
| bool | updateLabelValue = false |
||
| ) |
Function updates the property values of a label provided as templates. If a property exists in the destination label only the value will be updated (therefor observers and pointers stay valid). If the property does not exist, it will be cloned and added. No properties will be removed.
| templateLabel | Label instance that provides the new values for properties |
| updateLabelValue | Indicate if also the label value should be updated. |
| void mitk::Label::UpdateCenterOfMass | ( | const mitk::Point3D & | index, |
| const mitk::Point3D & | coordinates | ||
| ) |
|
static |
The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535.
Definition at line 100 of file mitkLabel.h.
|
staticconstexpr |
Definition at line 103 of file mitkLabel.h.