Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkLabelSelectionTool.h
Go to the documentation of this file.
1 /*============================================================================
2 The Medical Imaging Interaction Toolkit (MITK)
3 
4 Copyright (c) German Cancer Research Center (DKFZ)
5 All rights reserved.
6 
7 Use of this source code is governed by a 3-clause BSD license that can be
8 found in the LICENSE file.
9 
10 ============================================================================*/
11 
12 #ifndef mitkLabelSelectionTool_h
13 #define mitkLabelSelectionTool_h
14 
15 #include <mitkCommon.h>
16 #include <mitkSegTool2D.h>
18 
20 
21 
22 namespace mitk
23 {
37  {
38  public:
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42 
44 
47 
48  const char* GetName() const override;
49 
55 
56  itkGetConstMacro(CheckOnlyActiveGroup, bool);
57  itkSetMacro(CheckOnlyActiveGroup, bool);
58  itkBooleanMacro(CheckOnlyActiveGroup);
59 
60  void Activated() override;
61  void Deactivated() override;
62 
64  void UpdateLabels();
65 
66  protected:
68  ~LabelSelectionTool() override;
69 
70  virtual void OnMouseMoved(StateMachineAction*, InteractionEvent* interactionEvent);
71  virtual void OnMouseReleased(StateMachineAction*, InteractionEvent* interactionEvent);
72 
73  void ConnectActionsAndFunctions() override;
74 
75  private:
76  LabelHighlightGuard m_HighlightGuard;
77  Point3D m_LastCheckedIndex;
78  Point3D m_LastCheckedPoint;
79  bool m_CheckOnlyActiveGroup = false;
80  };
81 
82 } // namespace
83 
84 #endif
#define MITKSEGMENTATION_EXPORT
Base class for all interaction events in MITK.
RAII guard for managing label highlighting on data nodes.
Tools that allows to inspect and select labels via the render window.
~LabelSelectionTool() override
void Activated() override
Called when the tool gets activated.
void UpdateLabels()
Refreshes the displayed label highlight based on current cursor position.
void ConnectActionsAndFunctions() override
void Deactivated() override
Called when the tool gets deactivated.
us::ModuleResource GetIconResource() const override
Returns the tool button icon of the tool wrapped by a usModuleResource.
const char * GetName() const override
Returns the name of this tool. Make it short!
mitkClassMacro(LabelSelectionTool, SegTool2D)
MultiLabelSegmentation::LabelValueVectorType GetIndicatedLabels() const
Returns the label values currently indicated (under the cursor).
us::ModuleResource GetCursorIconResource() const override
Returns the cursor icon of the tool wrapped by a usModuleResource.
virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent)
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent)
Event/message/notification class.
Definition: mitkMessage.h:521
std::vector< LabelValueType > LabelValueVectorType
Abstract base class for segmentation tools.
Definition: mitkSegTool2D.h:57
Represents an action that is executed after a certain event in the state machine mechanism.
Represents a resource (text file, image, etc.) embedded in a CppMicroServices module.
Find image slices visible on a given plane.