Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitk::LabelSet Class Reference

#include <mitkLabelSet.h>

Inheritance diagram for mitk::LabelSet:
Collaboration diagram for mitk::LabelSet:

Public Types

typedef mitk::Label::PixelType PixelType
 
using LabelValueType = mitk::Label::PixelType
 
typedef std::map< LabelValueType, Label::PointerLabelContainerType
 
typedef LabelContainerType::const_iterator LabelContainerConstIteratorType
 
typedef LabelContainerType::iterator LabelContainerIteratorType
 
using ReservedLabelValuesFunctor = std::function< std::vector< LabelValueType >()>
 

Public Member Functions

 mitkClassMacroItkParent (LabelSet, itk::Object)
 
LabelContainerConstIteratorType IteratorConstBegin () const
 Returns a const iterator poiting to the begining of the container. More...
 
LabelContainerConstIteratorType IteratorConstEnd () const
 Returns a const iterator pointing to the end of the container. More...
 
LabelContainerIteratorType IteratorBegin ()
 Returns a iterator poiting to the begining of the container. More...
 
LabelContainerIteratorType IteratorEnd ()
 Returns a iterator pointing to the end of the container. More...
 
void OnLabelModified (const Object *, const itk::EventObject &)
 Recall itk::Object::Modified event from a label and send a ModifyLabelEvent. More...
 
void SetLayer (unsigned int)
 
void SetActiveLabel (PixelType)
 
void RemoveLabel (PixelType)
 
bool ExistLabel (PixelType)
 
mitk::LabelAddLabel (mitk::Label *label, bool addAsClone=true)
 Adds a label to the label set. More...
 
mitk::LabelAddLabel (const std::string &name, const Color &color)
 
void RenameLabel (PixelType, const std::string &, const Color &)
 
unsigned int GetNumberOfLabels () const
 
void SetAllLabelsVisible (bool)
 
void SetAllLabelsLocked (bool)
 
void RemoveAllLabels ()
 
void SetNextActiveLabel ()
 
LabelGetActiveLabel ()
 
const LabelGetActiveLabel () const
 
LabelGetLabel (PixelType pixelValue)
 
const LabelGetLabel (PixelType pixelValue) const
 
virtual int GetLayer ()
 
virtual int GetLayer () const
 
 itkGetModifiableObjectMacro (LookupTable, mitk::LookupTable)
 
void SetLookupTable (LookupTable *lut)
 
void UpdateLookupTable (PixelType pixelValue)
 
std::vector< LabelValueTypeGetUsedLabelValues () const
 

Static Public Member Functions

static Pointer New ()
 

Public Attributes

Message1< LabelValueTypeAddLabelEvent
 AddLabelEvent is emitted whenever a new label has been added to the LabelSet. More...
 
Message1< LabelValueTypeRemoveLabelEvent
 RemoveLabelEvent is emitted whenever a new label has been removed from the LabelSet. More...
 
Message1< LabelValueTypeModifyLabelEvent
 ModifyLabelEvent is emitted whenever a label has been modified from the LabelSet. More...
 
Message1< PixelTypeActiveLabelEvent
 ActiveLabelEvent is emitted whenever a label has been set as active in the LabelSet. More...
 
Message AllLabelsModifiedEvent
 AllLabelsModifiedEvent is emitted whenever a new label has been removed from the LabelSet. More...
 
ReservedLabelValuesFunctor m_ReservedLabelValuesFunctor
 

Protected Member Functions

 LabelSet ()
 
 LabelSet (const LabelSet &)
 
 mitkCloneMacro (Self)
 
 ~LabelSet () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 

Protected Attributes

LabelContainerType m_LabelContainer
 
LookupTable::Pointer m_LookupTable
 
PixelType m_ActiveLabelValue
 
unsigned int m_Layer
 

Detailed Description

Definition at line 34 of file mitkLabelSet.h.

Member Typedef Documentation

◆ LabelContainerConstIteratorType

typedef LabelContainerType::const_iterator mitk::LabelSet::LabelContainerConstIteratorType

Definition at line 44 of file mitkLabelSet.h.

◆ LabelContainerIteratorType

typedef LabelContainerType::iterator mitk::LabelSet::LabelContainerIteratorType

Definition at line 45 of file mitkLabelSet.h.

◆ LabelContainerType

Definition at line 43 of file mitkLabelSet.h.

◆ LabelValueType

◆ PixelType

◆ ReservedLabelValuesFunctor

using mitk::LabelSet::ReservedLabelValuesFunctor = std::function<std::vector<LabelValueType>()>

Definition at line 209 of file mitkLabelSet.h.

Constructor & Destructor Documentation

◆ LabelSet() [1/2]

mitk::LabelSet::LabelSet ( )
protected

◆ LabelSet() [2/2]

mitk::LabelSet::LabelSet ( const LabelSet )
protected

◆ ~LabelSet()

mitk::LabelSet::~LabelSet ( )
overrideprotected

Member Function Documentation

◆ AddLabel() [1/2]

mitk::Label* mitk::LabelSet::AddLabel ( const std::string &  name,
const Color color 
)

◆ AddLabel() [2/2]

mitk::Label* mitk::LabelSet::AddLabel ( mitk::Label label,
bool  addAsClone = true 
)

Adds a label to the label set.

Remarks
If the pixel value of the label is already used in the label set, the label will get a new none conflicting value assigned.
Parameters
labelInstance of an label that should be added or used as template
addAsCloneflag that control if the passed instance should be added or a clone of the instance.
Returns
Instance of the label as it was added to the label set.

◆ ExistLabel()

bool mitk::LabelSet::ExistLabel ( PixelType  )

◆ GetActiveLabel() [1/2]

Label* mitk::LabelSet::GetActiveLabel ( )
inline

Definition at line 183 of file mitkLabelSet.h.

◆ GetActiveLabel() [2/2]

const Label* mitk::LabelSet::GetActiveLabel ( ) const
inline

Definition at line 186 of file mitkLabelSet.h.

◆ GetLabel() [1/2]

Label* mitk::LabelSet::GetLabel ( PixelType  pixelValue)

◆ GetLabel() [2/2]

const Label* mitk::LabelSet::GetLabel ( PixelType  pixelValue) const

◆ GetLayer() [1/2]

virtual int mitk::LabelSet::GetLayer ( )
virtual

◆ GetLayer() [2/2]

virtual int mitk::LabelSet::GetLayer ( ) const
virtual

◆ GetNumberOfLabels()

unsigned int mitk::LabelSet::GetNumberOfLabels ( ) const

◆ GetUsedLabelValues()

std::vector<LabelValueType> mitk::LabelSet::GetUsedLabelValues ( ) const

◆ IteratorBegin()

LabelContainerIteratorType mitk::LabelSet::IteratorBegin ( )

Returns a iterator poiting to the begining of the container.

◆ IteratorConstBegin()

LabelContainerConstIteratorType mitk::LabelSet::IteratorConstBegin ( ) const

Returns a const iterator poiting to the begining of the container.

◆ IteratorConstEnd()

LabelContainerConstIteratorType mitk::LabelSet::IteratorConstEnd ( ) const

Returns a const iterator pointing to the end of the container.

◆ IteratorEnd()

LabelContainerIteratorType mitk::LabelSet::IteratorEnd ( )

Returns a iterator pointing to the end of the container.

◆ itkGetModifiableObjectMacro()

mitk::LabelSet::itkGetModifiableObjectMacro ( LookupTable  ,
mitk::LookupTable   
)

◆ mitkClassMacroItkParent()

mitk::LabelSet::mitkClassMacroItkParent ( LabelSet  ,
itk::Object   
)

◆ mitkCloneMacro()

mitk::LabelSet::mitkCloneMacro ( Self  )
protected

◆ New()

static Pointer mitk::LabelSet::New ( )
static

◆ OnLabelModified()

void mitk::LabelSet::OnLabelModified ( const Object *  ,
const itk::EventObject &   
)

Recall itk::Object::Modified event from a label and send a ModifyLabelEvent.

◆ PrintSelf()

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

◆ RemoveAllLabels()

void mitk::LabelSet::RemoveAllLabels ( )

◆ RemoveLabel()

void mitk::LabelSet::RemoveLabel ( PixelType  )

◆ RenameLabel()

void mitk::LabelSet::RenameLabel ( PixelType  ,
const std::string &  ,
const Color  
)

◆ SetActiveLabel()

void mitk::LabelSet::SetActiveLabel ( PixelType  )

◆ SetAllLabelsLocked()

void mitk::LabelSet::SetAllLabelsLocked ( bool  )

◆ SetAllLabelsVisible()

void mitk::LabelSet::SetAllLabelsVisible ( bool  )

◆ SetLayer()

void mitk::LabelSet::SetLayer ( unsigned int  )

◆ SetLookupTable()

void mitk::LabelSet::SetLookupTable ( LookupTable lut)

◆ SetNextActiveLabel()

void mitk::LabelSet::SetNextActiveLabel ( )

◆ UpdateLookupTable()

void mitk::LabelSet::UpdateLookupTable ( PixelType  pixelValue)

Member Data Documentation

◆ ActiveLabelEvent

Message1<PixelType> mitk::LabelSet::ActiveLabelEvent

ActiveLabelEvent is emitted whenever a label has been set as active in the LabelSet.

Definition at line 92 of file mitkLabelSet.h.

◆ AddLabelEvent

Message1<LabelValueType> mitk::LabelSet::AddLabelEvent

AddLabelEvent is emitted whenever a new label has been added to the LabelSet.

The registered method will be called with the label value of the added label. Observers should register to this event by calling myLabelSet->AddLabelEvent.AddListener(myObject, MyObject::MyMethod). After registering, myObject->MyMethod() will be called every time a new label has been added to the LabelSet. Observers should unregister by calling myLabelSet->AddLabelEvent.RemoveListener(myObject, MyObject::MyMethod).

member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for a Message1 object which is thread safe

Definition at line 59 of file mitkLabelSet.h.

◆ AllLabelsModifiedEvent

Message mitk::LabelSet::AllLabelsModifiedEvent

AllLabelsModifiedEvent is emitted whenever a new label has been removed from the LabelSet.

Observers should register to this event by calling myLabelSet->AllLabelsModifiedEvent.AddListener(myObject, MyObject::MyMethod). After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet. Observers should unregister by calling myLabelSet->AllLabelsModifiedEvent.RemoveListener(myObject, MyObject::MyMethod).

member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for a Message object which is thread safe

Definition at line 106 of file mitkLabelSet.h.

◆ m_ActiveLabelValue

PixelType mitk::LabelSet::m_ActiveLabelValue
protected

Definition at line 228 of file mitkLabelSet.h.

◆ m_LabelContainer

LabelContainerType mitk::LabelSet::m_LabelContainer
protected

Definition at line 224 of file mitkLabelSet.h.

◆ m_Layer

unsigned int mitk::LabelSet::m_Layer
protected

Definition at line 230 of file mitkLabelSet.h.

◆ m_LookupTable

LookupTable::Pointer mitk::LabelSet::m_LookupTable
protected

Definition at line 226 of file mitkLabelSet.h.

◆ m_ReservedLabelValuesFunctor

ReservedLabelValuesFunctor mitk::LabelSet::m_ReservedLabelValuesFunctor

Definition at line 210 of file mitkLabelSet.h.

◆ ModifyLabelEvent

Message1<LabelValueType> mitk::LabelSet::ModifyLabelEvent

ModifyLabelEvent is emitted whenever a label has been modified from the LabelSet.

The registered method will be called with the label value of the modified label. Observers should register to this event by calling myLabelSet->ModifyLabelEvent.AddListener(myObject, MyObject::MyMethod). After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet. Observers should unregister by calling myLabelSet->ModifyLabelEvent.RemoveListener(myObject, MyObject::MyMethod).

member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for a Message object which is thread safe

Definition at line 87 of file mitkLabelSet.h.

◆ RemoveLabelEvent

Message1<LabelValueType> mitk::LabelSet::RemoveLabelEvent

RemoveLabelEvent is emitted whenever a new label has been removed from the LabelSet.

The registered method will be called with the label value of the removed label. Observers should register to this event by calling myLabelSet->RemoveLabelEvent.AddListener(myObject, MyObject::MyMethod). After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet. Observers should unregister by calling myLabelSet->RemoveLabelEvent.RemoveListener(myObject, MyObject::MyMethod).

member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for a Message object which is thread safe

Definition at line 73 of file mitkLabelSet.h.


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