Medical Imaging Interaction Toolkit  2023.12.99-b884b24c
Medical Imaging Interaction Toolkit
mitk::Label Class Reference

A data structure describing a label. More...

#include <mitkLabel.h>

Inheritance diagram for mitk::Label:
Collaboration diagram for mitk::Label:

Public Types

typedef unsigned short PixelType
 
- Public Types inherited from mitk::PropertyList
typedef PropertyList Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::map< std::string, BaseProperty::PointerPropertyMap
 
typedef std::pair< std::string, BaseProperty::PointerPropertyMapElementType
 

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
 
std::string GetTrackingID () const
 
void SetCenterOfMassIndex (const mitk::Point3D &center)
 
mitk::Point3D GetCenterOfMassIndex () const
 
void SetCenterOfMassCoordinates (const mitk::Point3D &center)
 
mitk::Point3D GetCenterOfMassCoordinates () const
 
void SetColor (const mitk::Color &)
 
const mitk::ColorGetColor () const
 
void SetValue (PixelType pixelValue)
 
PixelType GetValue () const
 
void SetLayer (unsigned int layer)
 
unsigned int GetLayer () const
 
void SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
 Add new or change existent property. More...
 
void Modified ()
 
 Label ()
 
 Label (PixelType value, const std::string &name)
 
 ~Label () override
 
- Public Member Functions inherited from mitk::PropertyList
virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
BaseProperty::ConstPointer GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override
 Get property by its key. More...
 
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...
 
BasePropertyGetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override
 Get property by its key. 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::BasePropertyGetProperty (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 PropertyMapGetMap () 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
 
- 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 const char * GetStaticNameOfClass ()
 
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)
 
- 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...
 

Detailed Description

A data structure describing a label.

Definition at line 29 of file mitkLabel.h.

Member Typedef Documentation

◆ PixelType

typedef unsigned short mitk::Label::PixelType

Definition at line 34 of file mitkLabel.h.

Constructor & Destructor Documentation

◆ Label() [1/3]

mitk::Label::Label ( )

◆ Label() [2/3]

mitk::Label::Label ( PixelType  value,
const std::string &  name 
)

◆ ~Label()

mitk::Label::~Label ( )
override

◆ Label() [3/3]

mitk::Label::Label ( const Label other)
protected

Member Function Documentation

◆ GetCenterOfMassCoordinates()

mitk::Point3D mitk::Label::GetCenterOfMassCoordinates ( ) const

◆ GetCenterOfMassIndex()

mitk::Point3D mitk::Label::GetCenterOfMassIndex ( ) const

◆ GetColor()

const mitk::Color& mitk::Label::GetColor ( ) const

◆ GetLayer()

unsigned int mitk::Label::GetLayer ( ) const

◆ GetLocked()

bool mitk::Label::GetLocked ( ) const

◆ GetName()

std::string mitk::Label::GetName ( ) const

◆ GetOpacity()

float mitk::Label::GetOpacity ( ) const

◆ GetTrackingID()

std::string mitk::Label::GetTrackingID ( ) const

◆ GetValue()

PixelType mitk::Label::GetValue ( ) const

◆ GetVisible()

bool mitk::Label::GetVisible ( ) const

◆ mitkClassMacro()

mitk::Label::mitkClassMacro ( Label  ,
mitk::PropertyList   
)

◆ mitkNewMacro2Param()

mitk::Label::mitkNewMacro2Param ( Self  ,
PixelType  ,
const std::string &   
)

◆ Modified()

void mitk::Label::Modified ( )
inline

Definition at line 77 of file mitkLabel.h.

◆ New()

static Pointer mitk::Label::New ( )
static

◆ PrintSelf()

void mitk::Label::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

◆ SetCenterOfMassCoordinates()

void mitk::Label::SetCenterOfMassCoordinates ( const mitk::Point3D center)

◆ SetCenterOfMassIndex()

void mitk::Label::SetCenterOfMassIndex ( const mitk::Point3D center)

◆ SetColor()

void mitk::Label::SetColor ( const mitk::Color )

◆ SetLayer()

void mitk::Label::SetLayer ( unsigned int  layer)

◆ SetLocked()

void mitk::Label::SetLocked ( bool  locked)

◆ SetName()

void mitk::Label::SetName ( const std::string &  name)

◆ SetOpacity()

void mitk::Label::SetOpacity ( float  opacity)

◆ SetProperty()

void mitk::Label::SetProperty ( const std::string &  propertyKey,
BaseProperty property,
const std::string &  contextName = "",
bool  fallBackOnDefaultContext = false 
)
overridevirtual

Add new or change existent property.

Parameters
[in]propertyKeyKey of property.
[in]propertyThe actual property.
[in]contextNameOptional, default is empty string (default context). Context in which the property is set.
[in]fallBackOnDefaultContextOptional, default is false. Set property in default context if given context does not exist.
Precondition
If a context is specified by contextName, this context must be known by the owner or fallBackOnDefaultContext must be true. If violated an mitk::Exception is thrown.
propertyKey must be a none empty string. If violated an mitk::Exception is thrown.

Reimplemented from mitk::PropertyList.

◆ SetValue()

void mitk::Label::SetValue ( PixelType  pixelValue)

◆ SetVisible()

void mitk::Label::SetVisible ( bool  visible)

Member Data Documentation

◆ MAX_LABEL_VALUE

const PixelType mitk::Label::MAX_LABEL_VALUE
static

The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535.

Definition at line 40 of file mitkLabel.h.

◆ UNLABELED_VALUE

constexpr PixelType mitk::Label::UNLABELED_VALUE
staticconstexpr

Definition at line 43 of file mitkLabel.h.


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