Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkSegChangeOperationApplier.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 mitkSegChangeOperationApplier_h
14 #define mitkSegChangeOperationApplier_h
15 
16 #include <mitkCommon.h>
17 #include <mitkOperationActor.h>
19 
20 namespace mitk
21 {
37  {
38  public:
40 
41 
42  static SegChangeOperationApplier *GetInstance();
43 
47  void ExecuteOperation(Operation *op) override;
48 
49  protected:
51 
53  };
54 
55 
57 
68  {
69  public:
70 
71  using GroupIndexSetType = std::set<MultiLabelSegmentation::GroupIndexType>;
72 
83  const GroupIndexSetType& relevantGroupIDs, bool coverAllTimeSteps, TimeStepType timeStep = 0,
84  bool noLabels = false, bool noGroupImages = false, bool noNames = false);
85 
87 
91  void RegisterUndoRedoOperationEvent(const std::string& description);
92 
93  protected:
94  MultiLabelSegmentation::Pointer m_Segmentation;
98  bool m_NoLabels;
100  bool m_NoNames;
101 
103  };
104 
115  {
116  public:
117 
118  using GroupIndexSetType = std::set<MultiLabelSegmentation::GroupIndexType>;
119 
127  const GroupIndexSetType& relevantGroupIDs, bool noLabels = false, bool noGroupImages = false);
128 
130 
134  void RegisterUndoRedoOperationEvent(const std::string& description);
135 
136  protected:
137  MultiLabelSegmentation::Pointer m_Segmentation;
141 
143  };
144 
155  {
156  public:
157 
158  using GroupIndexSetType = std::set<MultiLabelSegmentation::GroupIndexType>;
159 
167  const GroupIndexSetType& relevantGroupIDs, bool noLabels = false, bool noGroupImages = false);
168 
170 
174  void RegisterUndoRedoOperationEvent(const std::string& description);
175 
176  protected:
177  MultiLabelSegmentation::Pointer m_Segmentation;
179 
180 
182  };
183 
194  {
195  public:
196 
202  const MultiLabelSegmentation::LabelValueVectorType& relevantLabels);
203 
205 
209  void RegisterUndoRedoOperationEvent(const std::string& description);
210 
211  protected:
212  MultiLabelSegmentation::Pointer m_Segmentation;
214 
215 
217  };
218 }
219 #endif
#define MITKSEGMENTATION_EXPORT
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
std::vector< LabelValueType > LabelValueVectorType
abstract class, that can be used by Undo to undo an operation.
Base class for all operations in the undo/redo framework.
Definition: mitkOperation.h:38
Executes all operations derived from SegChangeOperationBase.
mitkClassMacroNoParent(SegChangeOperationApplier) static SegChangeOperationApplier *GetInstance()
Return the singleton instance of the applier.
void ExecuteOperation(Operation *op) override
Execute a SegChangeOperationBase-derived operation on its target segmentation.
Base class for any operation based on a MultiLabelSegmentation instance.
RAII helper that captures state for undoing a group insert operation.
void RegisterUndoRedoOperationEvent(const std::string &description)
Capture the current (inserted) state as the redo operation and register the undo/redo pair.
SegGroupInsertUndoRedoHelper(MultiLabelSegmentation *segmentation, const GroupIndexSetType &relevantGroupIDs, bool noLabels=false, bool noGroupImages=false)
Prepare the undo operation (removal) for the groups that will be inserted.
std::set< MultiLabelSegmentation::GroupIndexType > GroupIndexSetType
MultiLabelSegmentation::Pointer m_Segmentation
RAII helper that captures the state of segmentation groups for undo/redo support.
SegGroupModifyUndoRedoHelper(MultiLabelSegmentation *segmentation, const GroupIndexSetType &relevantGroupIDs, bool coverAllTimeSteps, TimeStepType timeStep=0, bool noLabels=false, bool noGroupImages=false, bool noNames=false)
Capture the current state of the given groups as the undo operation.
std::set< MultiLabelSegmentation::GroupIndexType > GroupIndexSetType
MultiLabelSegmentation::Pointer m_Segmentation
void RegisterUndoRedoOperationEvent(const std::string &description)
Capture the current (modified) state as the redo operation and register the undo/redo pair.
RAII helper that captures state for undoing a group remove operation.
MultiLabelSegmentation::Pointer m_Segmentation
SegGroupRemoveUndoRedoHelper(MultiLabelSegmentation *segmentation, const GroupIndexSetType &relevantGroupIDs, bool noLabels=false, bool noGroupImages=false)
Capture the current state of the groups that will be removed (for undo).
std::set< MultiLabelSegmentation::GroupIndexType > GroupIndexSetType
void RegisterUndoRedoOperationEvent(const std::string &description)
Register the undo (insert) and redo (remove) operations on the undo stack.
RAII helper that captures state for undoing label property modifications.
MultiLabelSegmentation::LabelValueVectorType m_RelevantLabels
SegLabelPropModifyUndoRedoHelper(MultiLabelSegmentation *segmentation, const MultiLabelSegmentation::LabelValueVectorType &relevantLabels)
Capture the current properties of the specified labels for undo.
void RegisterUndoRedoOperationEvent(const std::string &description)
Capture the modified label properties as the redo operation and register the pair.
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).