Medical Imaging Interaction Toolkit  2026.06.00
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 
51  MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateNewSegmentationNode(const DataNode* referenceNode,
52  const Image* initialSegmentationImage = nullptr, const std::string& segmentationName = std::string(),
53  const DataStorage* dataStorage = nullptr);
54 
75  const Image* source);
76 
91  MITKMULTILABEL_EXPORT Label::Pointer CreateNewLabel(const MultiLabelSegmentation* labelSetImage, const std::string& namePrefix = "Label", bool hideIDIfUnique = false);
92 
108  MITKMULTILABEL_EXPORT mitk::Color SuggestNewLabelColor(const std::vector<mitk::Color>& usedColors);
109 
110  using GroupIDToLabelValueMapType = std::map<mitk::MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::LabelValueVectorType>;
112 
113  using LabelClassNameToLabelValueMapType = std::map<std::string, MultiLabelSegmentation::LabelValueVectorType>;
116 
119  using SourceToTargetGroupIDToLabelValueMappingMapType = std::map<MultiLabelSegmentation::GroupIndexType, std::map<MultiLabelSegmentation::GroupIndexType, LabelValueMappingVector> >;
123 
125 
130  MITKMULTILABEL_EXPORT std::string CreateDisplayLabelName(const MultiLabelSegmentation* labelSetImage, const Label* label);
131 
134  MITKMULTILABEL_EXPORT std::string CreateHTMLLabelName(const Label* label, const MultiLabelSegmentation* segmentation = nullptr);
135 
140  MITKMULTILABEL_EXPORT std::string CreateHTMLLabelDetails(const mitk::Label* label, const MultiLabelSegmentation* segmentation = nullptr);
141 
142  } // namespace LabelSetImageHelper
143 } // namespace mitk
144 
145 #endif
#define MITKMULTILABEL_EXPORT
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
Abstract data management class that organizes DataNode objects in a directed acyclic graph.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
A data structure describing a label in a multi-label segmentation.
Definition: mitkLabel.h:101
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
std::vector< LabelValueType > LabelValueVectorType
MITKMULTILABEL_EXPORT GroupIDToLabelValueMapType SplitLabelValuesByGroup(const MultiLabelSegmentation *labelSetImage, const MultiLabelSegmentation::LabelValueVectorType &labelValues)
MITKMULTILABEL_EXPORT LabelClassNameToLabelValueMapType SplitLabelValuesByClassName(const MultiLabelSegmentation *labelSetImage, MultiLabelSegmentation::GroupIndexType groupID)
MITKMULTILABEL_EXPORT std::string CreateDisplayGroupName(const MultiLabelSegmentation *labelSetImage, MultiLabelSegmentation::GroupIndexType groupID)
MITKMULTILABEL_EXPORT mitk::Color SuggestNewLabelColor(const std::vector< mitk::Color > &usedColors)
Suggests the next color from the MULTILABEL color scheme, given the colors already in use.
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....
std::map< std::string, MultiLabelSegmentation::LabelValueVectorType > LabelClassNameToLabelValueMapType
MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateEmptySegmentationNode(const std::string &segmentationName=std::string())
This function creates and returns a new empty segmentation data node.
std::map< MultiLabelSegmentation::GroupIndexType, std::map< MultiLabelSegmentation::GroupIndexType, LabelValueMappingVector > > SourceToTargetGroupIDToLabelValueMappingMapType
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 ...
std::map< mitk::MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::LabelValueVectorType > GroupIDToLabelValueMapType
MITKMULTILABEL_EXPORT SourceToTargetGroupIDToLabelValueMappingMapType SplitLabelValueMappingBySourceAndTargetGroup(const MultiLabelSegmentation *sourceSeg, const MultiLabelSegmentation *targetSeg, const LabelValueMappingVector &labelMapping)
MITKMULTILABEL_EXPORT std::string CreateDisplayLabelName(const MultiLabelSegmentation *labelSetImage, const Label *label)
MITKMULTILABEL_EXPORT std::string CreateHTMLLabelDetails(const mitk::Label *label, const MultiLabelSegmentation *segmentation=nullptr)
MITKMULTILABEL_EXPORT std::string CreateHTMLLabelName(const Label *label, const MultiLabelSegmentation *segmentation=nullptr)
MITKMULTILABEL_EXPORT void SetupDerivedSegmentation(MultiLabelSegmentation *seg, const Image *source)
Apply the typical defaults for a segmentation derived from a source image: establish the source-image...
Find image slices visible on a given plane.
std::vector< std::pair< Label::PixelType, Label::PixelType > > LabelValueMappingVector
itk::RGBPixel< float > Color
Standard RGB color typedef using float components.