Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkSegGroupModifyOperation.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 mitkSegGroupModifyOperation_h
14 #define mitkSegGroupModifyOperation_h
15 
19 
20 namespace mitk
21 {
22  class Image;
23 
32  {
33  public:
35 
36  using ModifyTSImageMapType = std::map<TimeStepType, Image::ConstPointer>;
37  using ModifyGroupImageMapType = std::map<MultiLabelSegmentation::GroupIndexType, ModifyTSImageMapType >;
38  using ModifyLabelsMapType = std::map<MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::ConstLabelVectorType>;
39  using GroupIndexVectorType = std::vector<MultiLabelSegmentation::GroupIndexType>;
40  using TimeStepVectorType = std::vector<TimeStepType>;
41  using ModifyGroupNameMapType = std::map<MultiLabelSegmentation::GroupIndexType, std::string >;
42 
50  const ModifyGroupImageMapType& modifiedGroupImages,
51  const ModifyLabelsMapType& modifiedLabels,
52  const ModifyGroupNameMapType& modifiedNames);
53 
54  ~SegGroupModifyOperation() override = default;
55 
58 
61 
64 
67 
74 
79 
82 
83  // Explicitly delete copy operations because internally std::unique_ptr are used.
86 
97  const std::set<MultiLabelSegmentation::GroupIndexType>& relevantGroupIDs, bool coverAllTimeSteps, TimeStepType timeStep = 0,
98  bool noLabels = false, bool noGroupImages = false, bool noNames = false);
99 
100  protected:
101  using ModifyCompressedImageMapType = std::map<MultiLabelSegmentation::GroupIndexType, std::map<TimeStepType, std::unique_ptr<CompressedImageContainer>>>;
105  };
106 
107 }
108 #endif
#define MITKSEGMENTATION_EXPORT
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
ConstLabelVector ConstLabelVectorType
Base class for any operation based on a MultiLabelSegmentation instance.
An Operation for modifying existing groups of a MultiLabelSegmentation.
mitkClassMacro(SegGroupModifyOperation, SegChangeOperationBase)
MultiLabelSegmentation::ConstLabelVectorType GetModifiedLabels(MultiLabelSegmentation::GroupIndexType groupID) const
Get the modified labels for a certain group.
~SegGroupModifyOperation() override=default
SegGroupModifyOperation(const SegGroupModifyOperation &)=delete
std::map< MultiLabelSegmentation::GroupIndexType, std::string > ModifyGroupNameMapType
GroupIndexVectorType GetNameGroupIDs() const
Get the group indices that have modified names.
TimeStepVectorType GetImageTimeSteps(MultiLabelSegmentation::GroupIndexType groupID) const
Get the time steps with modified images for a specific group.
std::vector< TimeStepType > TimeStepVectorType
GroupIndexVectorType GetLabelGroupIDs() const
Get the group indices that have modified label data.
ModifyCompressedImageMapType m_ModifiedImages
std::map< TimeStepType, Image::ConstPointer > ModifyTSImageMapType
std::map< MultiLabelSegmentation::GroupIndexType, ModifyTSImageMapType > ModifyGroupImageMapType
std::map< MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::ConstLabelVectorType > ModifyLabelsMapType
SegGroupModifyOperation(MultiLabelSegmentation *segmentation, const ModifyGroupImageMapType &modifiedGroupImages, const ModifyLabelsMapType &modifiedLabels, const ModifyGroupNameMapType &modifiedNames)
Construct a group modify operation with the given modified data.
GroupIndexVectorType GetImageGroupIDs() const
Get the group indices that have modified image data.
std::string GetModifiedName(MultiLabelSegmentation::GroupIndexType groupID) const
Get the modified name for a certain group.
static SegGroupModifyOperation * CreatFromSegmentation(MultiLabelSegmentation *segmentation, const std::set< MultiLabelSegmentation::GroupIndexType > &relevantGroupIDs, bool coverAllTimeSteps, TimeStepType timeStep=0, bool noLabels=false, bool noGroupImages=false, bool noNames=false)
Factory method that creates a modify operation from the current state of a segmentation.
std::vector< MultiLabelSegmentation::GroupIndexType > GroupIndexVectorType
Image::Pointer GetModifiedGroupImage(MultiLabelSegmentation::GroupIndexType groupID, TimeStepType timeStep) const
Get the modified group image for a certain group and time step.
SegGroupModifyOperation & operator=(const SegGroupModifyOperation &)=delete
std::map< MultiLabelSegmentation::GroupIndexType, std::map< TimeStepType, std::unique_ptr< CompressedImageContainer > >> ModifyCompressedImageMapType
class ITK_EXPORT Image
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).