Medical Imaging Interaction Toolkit  2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
mitkLabelSetImageHelper.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkLabelSetImageHelper_h
14 #define mitkLabelSetImageHelper_h
15 
16 #include <MitkMultilabelExports.h>
17 
18 #include <mitkDataNode.h>
19 #include <mitkLabelSetImage.h>
20 
21 namespace mitk
22 {
23  class DataStorage;
24 
25  namespace LabelSetImageHelper
26  {
33  MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateEmptySegmentationNode(const std::string& segmentationName = std::string());
34 
52  const Image* initialSegmentationImage = nullptr, const std::string& segmentationName = std::string(),
53  const DataStorage* dataStorage = nullptr);
54 
69  MITKMULTILABEL_EXPORT Label::Pointer CreateNewLabel(const MultiLabelSegmentation* labelSetImage, const std::string& namePrefix = "Label", bool hideIDIfUnique = false);
70 
71  using GroupIDToLabelValueMapType = std::map<mitk::MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::LabelValueVectorType>;
73 
74  using LabelClassNameToLabelValueMapType = std::map<std::string, MultiLabelSegmentation::LabelValueVectorType>;
77 
80  using SourceToTargetGroupIDToLabelValueMappingMapType = std::map<MultiLabelSegmentation::GroupIndexType, std::map<MultiLabelSegmentation::GroupIndexType, LabelValueMappingVector> >;
84 
86 
91  MITKMULTILABEL_EXPORT std::string CreateDisplayLabelName(const MultiLabelSegmentation* labelSetImage, const Label* label);
92 
95  MITKMULTILABEL_EXPORT std::string CreateHTMLLabelName(const Label* label, const MultiLabelSegmentation* segmentation = nullptr);
96  } // namespace LabelSetImageHelper
97 } // namespace mitk
98 
99 #endif
MITKMULTILABEL_EXPORT
#define MITKMULTILABEL_EXPORT
Definition: MitkMultilabelExports.h:15
mitk::LabelSetImageHelper::CreateDisplayGroupName
MITKMULTILABEL_EXPORT std::string CreateDisplayGroupName(const MultiLabelSegmentation *labelSetImage, MultiLabelSegmentation::GroupIndexType groupID)
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
mitk::LabelSetImageHelper::SourceToTargetGroupIDToLabelValueMappingMapType
std::map< MultiLabelSegmentation::GroupIndexType, std::map< MultiLabelSegmentation::GroupIndexType, LabelValueMappingVector > > SourceToTargetGroupIDToLabelValueMappingMapType
Definition: mitkLabelSetImageHelper.h:80
mitk::MultiLabelSegmentation::GroupIndexType
std::size_t GroupIndexType
Definition: mitkLabelSetImage.h:56
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::MultiLabelSegmentation::LabelValueVectorType
std::vector< LabelValueType > LabelValueVectorType
Definition: mitkLabelSetImage.h:60
mitk::Label
A data structure describing a label.
Definition: mitkLabel.h:29
mitk::LabelSetImageHelper::CreateNewLabel
MITKMULTILABEL_EXPORT Label::Pointer CreateNewLabel(const MultiLabelSegmentation *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 ...
mitk::MultiLabelSegmentation
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
Definition: mitkLabelSetImage.h:43
mitk::LabelSetImageHelper::GroupIDToLabelValueMapType
std::map< mitk::MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::LabelValueVectorType > GroupIDToLabelValueMapType
Definition: mitkLabelSetImageHelper.h:71
mitk::LabelSetImageHelper::SplitLabelValuesByGroup
MITKMULTILABEL_EXPORT GroupIDToLabelValueMapType SplitLabelValuesByGroup(const MultiLabelSegmentation *labelSetImage, const MultiLabelSegmentation::LabelValueVectorType &labelValues)
mitk::LabelSetImageHelper::CreateDisplayLabelName
MITKMULTILABEL_EXPORT std::string CreateDisplayLabelName(const MultiLabelSegmentation *labelSetImage, const Label *label)
mitk::DataStorage
Data management class that handles 'was created by' relations.
Definition: mitkDataStorage.h:43
mitk::LabelSetImageHelper::CreateEmptySegmentationNode
MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateEmptySegmentationNode(const std::string &segmentationName=std::string())
This function creates and returns a new empty segmentation data node.
mitkDataNode.h
mitk::LabelSetImageHelper::SplitLabelValueMappingBySourceAndTargetGroup
MITKMULTILABEL_EXPORT SourceToTargetGroupIDToLabelValueMappingMapType SplitLabelValueMappingBySourceAndTargetGroup(const MultiLabelSegmentation *sourceSeg, const MultiLabelSegmentation *targetSeg, const LabelValueMappingVector &labelMapping)
mitk::LabelSetImageHelper::SplitLabelValuesByClassName
MITKMULTILABEL_EXPORT LabelClassNameToLabelValueMapType SplitLabelValuesByClassName(const MultiLabelSegmentation *labelSetImage, MultiLabelSegmentation::GroupIndexType groupID)
mitk::LabelSetImageHelper::CreateNewSegmentationNode
MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateNewSegmentationNode(const DataNode *referenceNode, const Image *initialSegmentationImage=nullptr, const std::string &segmentationName=std::string(), const DataStorage *dataStorage=nullptr)
This function creates and returns a new data node with a new empty segmentation data structure....
mitk::LabelValueMappingVector
std::vector< std::pair< Label::PixelType, Label::PixelType > > LabelValueMappingVector
Definition: mitkLabelSetImage.h:742
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::LabelSetImageHelper::CreateHTMLLabelName
MITKMULTILABEL_EXPORT std::string CreateHTMLLabelName(const Label *label, const MultiLabelSegmentation *segmentation=nullptr)
mitk::LabelSetImageHelper::LabelClassNameToLabelValueMapType
std::map< std::string, MultiLabelSegmentation::LabelValueVectorType > LabelClassNameToLabelValueMapType
Definition: mitkLabelSetImageHelper.h:74
MitkMultilabelExports.h
mitkLabelSetImage.h