Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::SegGroupModifyOperation Class Reference

An Operation for modifying existing groups of a MultiLabelSegmentation. More...

#include <mitkSegGroupModifyOperation.h>

Inheritance diagram for mitk::SegGroupModifyOperation:
Collaboration diagram for mitk::SegGroupModifyOperation:

Public Types

using ModifyTSImageMapType = std::map< TimeStepType, Image::ConstPointer >
 
using ModifyGroupImageMapType = std::map< MultiLabelSegmentation::GroupIndexType, ModifyTSImageMapType >
 
using ModifyLabelsMapType = std::map< MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::ConstLabelVectorType >
 
using GroupIndexVectorType = std::vector< MultiLabelSegmentation::GroupIndexType >
 
using TimeStepVectorType = std::vector< TimeStepType >
 
using ModifyGroupNameMapType = std::map< MultiLabelSegmentation::GroupIndexType, std::string >
 

Public Member Functions

 mitkClassMacro (SegGroupModifyOperation, SegChangeOperationBase)
 
 SegGroupModifyOperation (MultiLabelSegmentation *segmentation, const ModifyGroupImageMapType &modifiedGroupImages, const ModifyLabelsMapType &modifiedLabels, const ModifyGroupNameMapType &modifiedNames)
 Construct a group modify operation with the given modified data. More...
 
 ~SegGroupModifyOperation () override=default
 
GroupIndexVectorType GetImageGroupIDs () const
 Get the group indices that have modified image data. More...
 
TimeStepVectorType GetImageTimeSteps (MultiLabelSegmentation::GroupIndexType groupID) const
 Get the time steps with modified images for a specific group. More...
 
GroupIndexVectorType GetLabelGroupIDs () const
 Get the group indices that have modified label data. More...
 
GroupIndexVectorType GetNameGroupIDs () const
 Get the group indices that have modified names. More...
 
Image::Pointer GetModifiedGroupImage (MultiLabelSegmentation::GroupIndexType groupID, TimeStepType timeStep) const
 Get the modified group image for a certain group and time step. More...
 
MultiLabelSegmentation::ConstLabelVectorType GetModifiedLabels (MultiLabelSegmentation::GroupIndexType groupID) const
 Get the modified labels for a certain group. More...
 
std::string GetModifiedName (MultiLabelSegmentation::GroupIndexType groupID) const
 Get the modified name for a certain group. More...
 
 SegGroupModifyOperation (const SegGroupModifyOperation &)=delete
 
SegGroupModifyOperation & operator= (const SegGroupModifyOperation &)=delete
 
- Public Member Functions inherited from mitk::SegChangeOperationBase
 mitkClassMacro (SegChangeOperationBase, Operation)
 
 ~SegChangeOperationBase () override=default
 
bool IsValid () const override
 Check whether the operation is still valid (i.e., the segmentation still exists). More...
 
mitk::MultiLabelSegmentation::Pointer GetSegmentation ()
 Get the target segmentation (mutable). More...
 
const mitk::MultiLabelSegmentation::ConstPointer GetSegmentation () const
 Get the target segmentation (const). More...
 
- Public Member Functions inherited from mitk::Operation
 mitkClassMacroNoParent (Operation) virtual bool IsValid() const
 Check whether this operation is still valid and can be executed. More...
 
virtual ~Operation ()=default
 Virtual destructor. More...
 
OperationType GetOperationType ()
 Get the type identifier of this operation. More...
 

Static Public Member Functions

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. More...
 

Protected Types

using ModifyCompressedImageMapType = std::map< MultiLabelSegmentation::GroupIndexType, std::map< TimeStepType, std::unique_ptr< CompressedImageContainer > >>
 

Protected Attributes

ModifyCompressedImageMapType m_ModifiedImages
 
ModifyLabelsMapType m_ModifiedLabels
 
ModifyGroupNameMapType m_ModifiedNames
 
- Protected Attributes inherited from mitk::Operation
OperationType m_OperationType
 The type identifier for this operation. More...
 

Additional Inherited Members

- Protected Member Functions inherited from mitk::SegChangeOperationBase
 SegChangeOperationBase (mitk::MultiLabelSegmentation *segmentation, OperationType operationType)
 
 SegChangeOperationBase (SegChangeOperationBase &&)=default
 
SegChangeOperationBase & operator= (const SegChangeOperationBase &)=default
 
SegChangeOperationBase & operator= (SegChangeOperationBase &&)=default
 
- Protected Member Functions inherited from mitk::Operation
 Operation (OperationType operationType)
 Construct an operation with the given type. More...
 
 Operation (const Operation &)=default
 
 Operation (Operation &&)=default
 
Operation & operator= (const Operation &)=default
 
Operation & operator= (Operation &&)=default
 

Detailed Description

An Operation for modifying existing groups of a MultiLabelSegmentation.

See also
SegChangeOperationApplier

This Operation stores modified group images, labels, and names and can be used to realize undo-redo functionality for segmentation group modifications.

Definition at line 31 of file mitkSegGroupModifyOperation.h.

Member Typedef Documentation

◆ GroupIndexVectorType

◆ ModifyCompressedImageMapType

◆ ModifyGroupImageMapType

◆ ModifyGroupNameMapType

◆ ModifyLabelsMapType

◆ ModifyTSImageMapType

using mitk::SegGroupModifyOperation::ModifyTSImageMapType = std::map<TimeStepType, Image::ConstPointer>

Definition at line 36 of file mitkSegGroupModifyOperation.h.

◆ TimeStepVectorType

Constructor & Destructor Documentation

◆ SegGroupModifyOperation() [1/2]

mitk::SegGroupModifyOperation::SegGroupModifyOperation ( MultiLabelSegmentation *  segmentation,
const ModifyGroupImageMapType &  modifiedGroupImages,
const ModifyLabelsMapType &  modifiedLabels,
const ModifyGroupNameMapType &  modifiedNames 
)

Construct a group modify operation with the given modified data.

Parameters
segmentationThe target segmentation.
modifiedGroupImagesMap of group index to time-step-indexed modified images.
modifiedLabelsMap of group index to modified label vectors.
modifiedNamesMap of group index to modified group names.

◆ ~SegGroupModifyOperation()

mitk::SegGroupModifyOperation::~SegGroupModifyOperation ( )
overridedefault

◆ SegGroupModifyOperation() [2/2]

mitk::SegGroupModifyOperation::SegGroupModifyOperation ( const SegGroupModifyOperation &  )
delete

Member Function Documentation

◆ CreatFromSegmentation()

static SegGroupModifyOperation* mitk::SegGroupModifyOperation::CreatFromSegmentation ( MultiLabelSegmentation *  segmentation,
const std::set< MultiLabelSegmentation::GroupIndexType > &  relevantGroupIDs,
bool  coverAllTimeSteps,
TimeStepType  timeStep = 0,
bool  noLabels = false,
bool  noGroupImages = false,
bool  noNames = false 
)
static

Factory method that creates a modify operation from the current state of a segmentation.

Parameters
segmentationThe segmentation to capture state from.
relevantGroupIDsThe group indices to capture.
coverAllTimeStepsIf true, all time steps are captured; otherwise only the specified one.
timeStepThe time step to capture (only used if coverAllTimeSteps is false).
noLabelsIf true, label information is not captured.
noGroupImagesIf true, group image data is not captured.
noNamesIf true, group names are not captured.

◆ GetImageGroupIDs()

GroupIndexVectorType mitk::SegGroupModifyOperation::GetImageGroupIDs ( ) const

Get the group indices that have modified image data.

◆ GetImageTimeSteps()

TimeStepVectorType mitk::SegGroupModifyOperation::GetImageTimeSteps ( MultiLabelSegmentation::GroupIndexType  groupID) const

Get the time steps with modified images for a specific group.

◆ GetLabelGroupIDs()

GroupIndexVectorType mitk::SegGroupModifyOperation::GetLabelGroupIDs ( ) const

Get the group indices that have modified label data.

◆ GetModifiedGroupImage()

Image::Pointer mitk::SegGroupModifyOperation::GetModifiedGroupImage ( MultiLabelSegmentation::GroupIndexType  groupID,
TimeStepType  timeStep 
) const

Get the modified group image for a certain group and time step.

Parameters
groupIDThe group index.
timeStepThe time step.
Returns
The stored modified image, decompressed from the internal container.

◆ GetModifiedLabels()

MultiLabelSegmentation::ConstLabelVectorType mitk::SegGroupModifyOperation::GetModifiedLabels ( MultiLabelSegmentation::GroupIndexType  groupID) const

Get the modified labels for a certain group.

Parameters
groupIDThe group index.

◆ GetModifiedName()

std::string mitk::SegGroupModifyOperation::GetModifiedName ( MultiLabelSegmentation::GroupIndexType  groupID) const

Get the modified name for a certain group.

◆ GetNameGroupIDs()

GroupIndexVectorType mitk::SegGroupModifyOperation::GetNameGroupIDs ( ) const

Get the group indices that have modified names.

◆ mitkClassMacro()

mitk::SegGroupModifyOperation::mitkClassMacro ( SegGroupModifyOperation  ,
SegChangeOperationBase   
)

◆ operator=()

SegGroupModifyOperation& mitk::SegGroupModifyOperation::operator= ( const SegGroupModifyOperation &  )
delete

Member Data Documentation

◆ m_ModifiedImages

ModifyCompressedImageMapType mitk::SegGroupModifyOperation::m_ModifiedImages
protected

Definition at line 102 of file mitkSegGroupModifyOperation.h.

◆ m_ModifiedLabels

ModifyLabelsMapType mitk::SegGroupModifyOperation::m_ModifiedLabels
protected

Definition at line 103 of file mitkSegGroupModifyOperation.h.

◆ m_ModifiedNames

ModifyGroupNameMapType mitk::SegGroupModifyOperation::m_ModifiedNames
protected

Definition at line 104 of file mitkSegGroupModifyOperation.h.


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