Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::LabelSetImageHelper Namespace Reference

Typedefs

using GroupIDToLabelValueMapType = std::map< mitk::LabelSetImage::GroupIndexType, LabelSetImage::LabelValueVectorType >
 
using LabelClassNameToLabelValueMapType = std::map< std::string, LabelSetImage::LabelValueVectorType >
 

Functions

MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateEmptySegmentationNode (const std::string &segmentationName=std::string())
 This function creates and returns a new empty segmentation data node. More...
 
MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateNewSegmentationNode (const DataNode *referenceNode, const Image *initialSegmentationImage=nullptr, const std::string &segmentationName=std::string())
 This function creates and returns a new data node with a new empty segmentation data structure. The segmentation node is named according to the given reference data node, otherwise a name is passed explicitly. Some properties are set to ensure a proper setup segmentation and node (e.g. link the segmentation node with its parent node). More...
 
MITKMULTILABEL_EXPORT Label::Pointer CreateNewLabel (const LabelSetImage *labelSetImage, const std::string &namePrefix="Label", bool hideIDIfUnique=false)
 This function creates and returns a new label. The label is automatically assigned an unused generic label name, depending on existing label names in all label sets of the given label set image. The color of the label is selected from the MULTILABEL lookup table, following the same rules of the naming to likely chose a unique color. More...
 
MITKMULTILABEL_EXPORT GroupIDToLabelValueMapType SplitLabelValuesByGroup (const LabelSetImage *labelSetImage, const LabelSetImage::LabelValueVectorType &labelValues)
 
MITKMULTILABEL_EXPORT LabelClassNameToLabelValueMapType SplitLabelValuesByClassNamwe (const LabelSetImage *labelSetImage, LabelSetImage::GroupIndexType groupID)
 
MITKMULTILABEL_EXPORT LabelClassNameToLabelValueMapType SplitLabelValuesByClassNamwe (const LabelSetImage *labelSetImage, LabelSetImage::GroupIndexType groupID, const LabelSetImage::LabelValueVectorType &labelValues)
 
MITKMULTILABEL_EXPORT std::string CreateDisplayGroupName (const LabelSetImage *labelSetImage, LabelSetImage::GroupIndexType groupID)
 

Typedef Documentation

◆ GroupIDToLabelValueMapType

◆ LabelClassNameToLabelValueMapType

Function Documentation

◆ CreateDisplayGroupName()

MITKMULTILABEL_EXPORT std::string mitk::LabelSetImageHelper::CreateDisplayGroupName ( const LabelSetImage labelSetImage,
LabelSetImage::GroupIndexType  groupID 
)

◆ CreateEmptySegmentationNode()

MITKMULTILABEL_EXPORT mitk::DataNode::Pointer mitk::LabelSetImageHelper::CreateEmptySegmentationNode ( const std::string &  segmentationName = std::string())

This function creates and returns a new empty segmentation data node.

Remarks
The data is not set. Set it manually to have a properly setup node.
Parameters
segmentationNameA name for the new segmentation node.
Returns
The new segmentation node as a data node pointer.

◆ CreateNewLabel()

MITKMULTILABEL_EXPORT Label::Pointer mitk::LabelSetImageHelper::CreateNewLabel ( const LabelSetImage labelSetImage,
const std::string &  namePrefix = "Label",
bool  hideIDIfUnique = false 
)

This function creates and returns a new label. The label is automatically assigned an unused generic label name, depending on existing label names in all label sets of the given label set image. The color of the label is selected from the MULTILABEL lookup table, following the same rules of the naming to likely chose a unique color.

Parameters
labelSetImageThe label set image that the new label is added to
namePrefixThe prefix of the label name that is prepended by a sequential number
hideIDIfUniqueIndicates if the ID suffix should be added if the label name prefix would be already unique. true: only add if not unique; false: add always.
Returns
The new label.

◆ CreateNewSegmentationNode()

MITKMULTILABEL_EXPORT mitk::DataNode::Pointer mitk::LabelSetImageHelper::CreateNewSegmentationNode ( const DataNode referenceNode,
const Image initialSegmentationImage = nullptr,
const std::string &  segmentationName = std::string() 
)

This function creates and returns a new data node with a new empty segmentation data structure. The segmentation node is named according to the given reference data node, otherwise a name is passed explicitly. Some properties are set to ensure a proper setup segmentation and node (e.g. link the segmentation node with its parent node).

Parameters
referenceNodeThe reference node from which the name of the new segmentation node is derived.
initialSegmentationImageThe segmentation image that is used to initialize the label set image.
segmentationNameAn optional name for the new segmentation node.
Returns
The new segmentation node as a data node pointer.

◆ SplitLabelValuesByClassNamwe() [1/2]

MITKMULTILABEL_EXPORT LabelClassNameToLabelValueMapType mitk::LabelSetImageHelper::SplitLabelValuesByClassNamwe ( const LabelSetImage labelSetImage,
LabelSetImage::GroupIndexType  groupID 
)

◆ SplitLabelValuesByClassNamwe() [2/2]

MITKMULTILABEL_EXPORT LabelClassNameToLabelValueMapType mitk::LabelSetImageHelper::SplitLabelValuesByClassNamwe ( const LabelSetImage labelSetImage,
LabelSetImage::GroupIndexType  groupID,
const LabelSetImage::LabelValueVectorType labelValues 
)

◆ SplitLabelValuesByGroup()

MITKMULTILABEL_EXPORT GroupIDToLabelValueMapType mitk::LabelSetImageHelper::SplitLabelValuesByGroup ( const LabelSetImage labelSetImage,
const LabelSetImage::LabelValueVectorType labelValues 
)