33 namespace LabelPropertyConstants
453 void SetProperty(
const std::string &propertyKey,
BaseProperty *property,
const std::string &contextName =
"",
bool fallBackOnDefaultContext =
false)
override;
462 BaseProperty::ConstPointer
GetConstProperty(
const std::string& propertyKey,
const std::string& contextName =
"",
bool fallBackOnDefaultContext =
true)
const override;
473 using itk::Object::Modified;
483 void Update(
const Label* templateLabel,
bool updateLabelValue =
false);
504 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
532 std::optional<DICOMCodeSequence> GetDICOMCodeSequenceFromProperties(
const PropertyKeyPath& basePath)
const;
539 std::optional<DICOMCodeSequenceWithModifiers> GetDICOMCodeSequenceWithModifiersFromProperties(
const PropertyKeyPath& basePath)
const;
545 void RemoveDICOMCodeSequenceProperties(
const PropertyKeyPath& basePath);
#define MITKMULTILABEL_EXPORT
Abstract base class for properties.
Represents a DICOM Code Sequence with optional modifiers.
Represents a DICOM Code Sequence with value, scheme, and meaning.
A data structure describing a label in a multi-label segmentation.
DICOMCodeSequenceWithModifiers GetAnatomicRegion(std::size_t index=0) const
Gets an anatomic region code at the specified index.
std::string GetAlgorithmName() const
Returns the name of the algorithm used to create or modify this label.
void ResetCenterOfMass()
Resets (clears) the center of mass properties.
BaseProperty * GetNonConstProperty(const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override
Returns a non-const pointer to the property with the given key.
mitk::Point3D GetCenterOfMassCoordinates() const
Returns the center of mass of the label in world coordinates.
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 de...
bool HasAlgorithmName() const
Returns whether an algorithm name property is set on the label.
void Modified()
Marks this label as modified.
~Label() override
Destructor.
bool GetVisible() const
Returns the visibility state of the label.
void MergeToolUses(const Label *other)
Absorbs another label's recorded provenance (algorithm type and tool names) into this one.
void SetValue(PixelType pixelValue)
Sets the pixel value that identifies this label in the segmentation image.
void SetPrimaryAnatomicStructure(const DICOMCodeSequenceWithModifiers &code, std::size_t index=0)
Sets a primary anatomic structure code at the specified index.
void SetTrackingID(const std::string &trackingID)
Sets the DICOM tracking ID of the label.
std::string GetName() const
Returns the (class) name of the label.
mitkNewMacro2Param(Self, PixelType, const std::string &)
std::optional< DICOMCodeSequence > GetSegmentedPropertyCategory() const
Gets the segmented property category code.
void SetOpacity(float opacity)
Sets the opacity of the label for rendering.
void SetAlgorithmName(const std::string &algoName)
Sets the name of the algorithm used to create or modify this label.
void SetSegmentedPropertyType(const DICOMCodeSequenceWithModifiers &code)
Sets the segmented property type code with optional modifiers.
bool HasTrackingUID() const
Returns whether a tracking UID property is set on the label.
void SetCenterOfMassCoordinates(const mitk::Point3D ¢er)
mitk::Point3D GetCenterOfMassIndex() const
Returns the center of mass of the label as image index coordinates.
std::string GetDescription() const
Returns the textual description of the label.
void SetAnatomicRegion(const DICOMCodeSequenceWithModifiers &code, std::size_t index=0)
Sets an anatomic region code at the specified index.
AlgorithmType GetAlgorithmType() const
Returns the algorithm type used to create or modify this label.
void SetAlgorithmType(AlgorithmType algoType)
Sets the algorithm type that was used to create or modify this label.
std::string GetAlgorithmTypeStr() const
Returns the algorithm type as a string.
std::string GetTrackingUID() const
Returns the DICOM tracking unique identifier (UID) of the label.
void SetSegmentedPropertyCategory(const DICOMCodeSequence &code)
Sets the segmented property category code.
void SetTrackingUID(const std::string &trackingUID)
Sets the DICOM tracking unique identifier (UID) of the label.
float GetOpacity() const
Returns the opacity of the label.
unsigned short PixelType
Pixel type used for label values (unsigned short).
void SetName(const std::string &name)
Sets the (class) name of the label.
void SetLocked(bool locked)
Sets the lock state of the label.
BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override
Returns a const pointer to the property with the given key.
PixelType GetValue() const
Returns the pixel value that identifies this label in the segmentation image.
void UpdateCenterOfMass(const mitk::Point3D &index, const mitk::Point3D &coordinates)
Updates the center of mass with new index and world coordinates.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
AlgorithmType
Enumeration describing how a label was created or refined.
void SetColor(const mitk::Color &color)
Sets the display color of the label.
void SetVisible(bool visible)
Sets the visibility state of the label for rendering.
std::size_t GetPrimaryAnatomicStructureCount() const
Gets the number of primary anatomic structure codes stored.
Label(const Label &other)
bool GetLocked() const
Returns the lock state of the label.
DICOMCodeSequenceWithModifiers GetPrimaryAnatomicStructure(std::size_t index=0) const
Gets a primary anatomic structure code at the specified index.
const mitk::Color & GetColor() const
Returns the display color of the label.
void SetCenterOfMassIndex(const mitk::Point3D ¢er)
Label(PixelType value, const std::string &name)
Constructor that creates a label with a specified pixel value and name.
std::optional< DICOMCodeSequenceWithModifiers > GetSegmentedPropertyType() const
Gets the segmented property type code with modifiers.
std::string GetTrackingID() const
Returns the DICOM tracking ID of the label.
mitkClassMacro(Label, mitk::PropertyList)
std::size_t GetAnatomicRegionCount() const
Gets the number of anatomic region codes stored.
itk::ModifiedTimeType GetCenterOfMassMTime() const
Returns the modification time of the last center of mass property update.
void SetAlgorithmTypeStr(const std::string &algoType)
Sets the algorithm type from a string representation.
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
Sets a property on this label.
static const PixelType MAX_LABEL_VALUE
The maximum value a label can have (65535 for unsigned short).
void AddToolUse(AlgorithmType algoType, const std::string &algoName)
Records that a tool/operation contributed to this label, updating algorithm type and name.
void RemovePrimaryAnatomicStructure(std::size_t index)
Removes a primary anatomic structure code at the specified index.
void RemoveAnatomicRegion(std::size_t index)
Removes an anatomic region code at the specified index.
bool HasTrackingID() const
Returns whether a tracking ID property is set on the label.
void SetDescription(const std::string &description)
Sets a textual description for the label.
Label()
Default constructor. Creates a label with default properties.
Class that can be used to specify nested or wild carded property keys. E.g. for the use in context of...
Key-value list holding instances of BaseProperty.
mitk::BaseProperty * GetProperty(const std::string &propertyKey) const
Get a property by its name.
MITKMULTILABEL_EXPORT const std::string & GetSchemePropertySubName()
Gets the property key path element for code scheme.
MITKMULTILABEL_EXPORT const std::string & GetPrimaryAnatomicStructurePropertyBaseName()
Gets the property key path element for primary anatomic structure.
MITKMULTILABEL_EXPORT const std::string & GetAnatomicRegionPropertyBaseName()
Gets the property key path element for anatomic region.
MITKMULTILABEL_EXPORT const std::string & GetMeaningPropertySubName()
Gets the property key path element for code meaning.
MITKMULTILABEL_EXPORT const std::string & GetValuePropertySubName()
Gets the property key path element for code value.
MITKMULTILABEL_EXPORT const std::string & GetSegmentedPropertyCategoryPropertyBaseName()
Gets the property key path element for segmented property category.
MITKMULTILABEL_EXPORT const std::string & GetModifierPropertySubName()
Gets the property key path element for modifier.
MITKMULTILABEL_EXPORT const std::string & GetSegmentedPropertyTypePropertyBaseName()
Gets the property key path element for segmented property type.
Find image slices visible on a given plane.
std::vector< Label::ConstPointer > ConstLabelVector
Type alias for a vector of const Label smart pointers.
MITKCORE_EXPORT const ScalarType eps
Epsilon value for floating point comparison (vnl_math::eps * 100).
std::vector< Label::Pointer > LabelVector
Type alias for a vector of mutable Label smart pointers.
itk::RGBPixel< float > Color
Standard RGB color typedef using float components.
double ScalarType
Scalar type used throughout MITK for geometric computations.
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.