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

An Operation for inserting groups into a MultiLabelSegmentation. More...

#include <mitkSegGroupInsertOperation.h>

Inheritance diagram for mitk::SegGroupInsertOperation:
Collaboration diagram for mitk::SegGroupInsertOperation:

Public Types

using ModifyGroupImageMapType = std::map< MultiLabelSegmentation::GroupIndexType, Image::ConstPointer >
 
using ModifyLabelsMapType = std::map< MultiLabelSegmentation::GroupIndexType, MultiLabelSegmentation::ConstLabelVectorType >
 
using GroupIndexSetType = std::set< MultiLabelSegmentation::GroupIndexType >
 
using ModifyGroupNameMapType = std::map< MultiLabelSegmentation::GroupIndexType, std::string >
 

Public Member Functions

 mitkClassMacro (SegGroupInsertOperation, SegChangeOperationBase)
 
 SegGroupInsertOperation (MultiLabelSegmentation *segmentation, const GroupIndexSetType &groupIDs, const ModifyGroupImageMapType &groupImages={}, const ModifyLabelsMapType &groupLabels={})
 Construct an insert operation with the given group data. More...
 
 ~SegGroupInsertOperation () override=default
 
GroupIndexSetType GetGroupIDs () const
 Get all group indices managed by this operation. More...
 
GroupIndexSetType GetImageGroupIDs () const
 Get the group indices that have associated image data. More...
 
GroupIndexSetType GetLabelGroupIDs () const
 Get the group indices that have associated label data. More...
 
Image::Pointer GetGroupImage (MultiLabelSegmentation::GroupIndexType groupID) const
 Get the group image for a specific group index. More...
 
MultiLabelSegmentation::ConstLabelVectorType GetGroupLabels (MultiLabelSegmentation::GroupIndexType groupID) const
 Get the labels for a specific group index. More...
 
std::string GetGroupName (MultiLabelSegmentation::GroupIndexType groupID) const
 Get the group name for a specific group index. More...
 
 SegGroupInsertOperation (const SegGroupInsertOperation &)=delete
 
SegGroupInsertOperation & operator= (const SegGroupInsertOperation &)=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 SegGroupInsertOperation * CreateFromSegmentation (MultiLabelSegmentation *segmentation, const GroupIndexSetType &relevantGroupIDs, bool noLabels=false, bool noGroupImages=false)
 Factory method that creates an insert operation from the current state of a segmentation. More...
 

Protected Types

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

Protected Attributes

GroupIndexSetType m_GroupIDs
 
ModifyCompressedImageMapType m_Images
 
ModifyLabelsMapType m_Labels
 
ModifyGroupNameMapType m_Names
 
- 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 inserting groups into a MultiLabelSegmentation.

See also
SegChangeOperationApplier

This Operation can be used to realize undo-redo functionality for group insertion in segmentation workflows. It stores group images, labels, and names to be inserted at specific group indices.

Definition at line 32 of file mitkSegGroupInsertOperation.h.

Member Typedef Documentation

◆ GroupIndexSetType

◆ ModifyCompressedImageMapType

◆ ModifyGroupImageMapType

◆ ModifyGroupNameMapType

◆ ModifyLabelsMapType

Constructor & Destructor Documentation

◆ SegGroupInsertOperation() [1/2]

mitk::SegGroupInsertOperation::SegGroupInsertOperation ( MultiLabelSegmentation *  segmentation,
const GroupIndexSetType &  groupIDs,
const ModifyGroupImageMapType &  groupImages = {},
const ModifyLabelsMapType &  groupLabels = {} 
)

Construct an insert operation with the given group data.

Parameters
segmentationThe target segmentation.
groupIDsThe set of group indices to insert.
groupImagesOptional map of group images to insert.
groupLabelsOptional map of labels to insert for each group.

◆ ~SegGroupInsertOperation()

mitk::SegGroupInsertOperation::~SegGroupInsertOperation ( )
overridedefault

◆ SegGroupInsertOperation() [2/2]

mitk::SegGroupInsertOperation::SegGroupInsertOperation ( const SegGroupInsertOperation &  )
delete

Member Function Documentation

◆ CreateFromSegmentation()

static SegGroupInsertOperation* mitk::SegGroupInsertOperation::CreateFromSegmentation ( MultiLabelSegmentation *  segmentation,
const GroupIndexSetType &  relevantGroupIDs,
bool  noLabels = false,
bool  noGroupImages = false 
)
static

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

Parameters
segmentationThe segmentation to capture state from.
relevantGroupIDsThe group indices to capture.
noLabelsIf true, label information is not captured.
noGroupImagesIf true, group image data is not captured.

◆ GetGroupIDs()

GroupIndexSetType mitk::SegGroupInsertOperation::GetGroupIDs ( ) const

Get all group indices managed by this operation.

◆ GetGroupImage()

Image::Pointer mitk::SegGroupInsertOperation::GetGroupImage ( MultiLabelSegmentation::GroupIndexType  groupID) const

Get the group image for a specific group index.

Parameters
groupIDThe group index.
Returns
The stored group image, decompressed from the internal container.

◆ GetGroupLabels()

MultiLabelSegmentation::ConstLabelVectorType mitk::SegGroupInsertOperation::GetGroupLabels ( MultiLabelSegmentation::GroupIndexType  groupID) const

Get the labels for a specific group index.

◆ GetGroupName()

std::string mitk::SegGroupInsertOperation::GetGroupName ( MultiLabelSegmentation::GroupIndexType  groupID) const

Get the group name for a specific group index.

◆ GetImageGroupIDs()

GroupIndexSetType mitk::SegGroupInsertOperation::GetImageGroupIDs ( ) const

Get the group indices that have associated image data.

◆ GetLabelGroupIDs()

GroupIndexSetType mitk::SegGroupInsertOperation::GetLabelGroupIDs ( ) const

Get the group indices that have associated label data.

◆ mitkClassMacro()

mitk::SegGroupInsertOperation::mitkClassMacro ( SegGroupInsertOperation  ,
SegChangeOperationBase   
)

◆ operator=()

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

Member Data Documentation

◆ m_GroupIDs

GroupIndexSetType mitk::SegGroupInsertOperation::m_GroupIDs
protected

Definition at line 92 of file mitkSegGroupInsertOperation.h.

◆ m_Images

ModifyCompressedImageMapType mitk::SegGroupInsertOperation::m_Images
protected

Definition at line 93 of file mitkSegGroupInsertOperation.h.

◆ m_Labels

ModifyLabelsMapType mitk::SegGroupInsertOperation::m_Labels
protected

Definition at line 94 of file mitkSegGroupInsertOperation.h.

◆ m_Names

ModifyGroupNameMapType mitk::SegGroupInsertOperation::m_Names
protected

Definition at line 95 of file mitkSegGroupInsertOperation.h.


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