Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkMedSAMTool.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 mitkMedSAMTool_h
14 #define mitkMedSAMTool_h
15 
19 #include <mitkRenderingManager.h>
20 
21 namespace us
22 {
23  class ModuleResource;
24 }
25 
26 namespace mitk
27 {
37  {
38  public:
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42 
43  const char *GetName() const override;
44 
45  void Activated() override;
46  void Deactivated() override;
47  bool HasPicks() const override;
48  void ClearPicks() override;
49  void ConnectActionsAndFunctions() override;
50  std::string GetPointsAsCSVString(const mitk::BaseGeometry *baseGeometry) const override;
51 
57 
63 
67 
68  protected:
69  MedSAMTool() = default;
70  ~MedSAMTool() = default;
71 
72  private:
77  void CreateBoundingShapeInteractor(bool rotationEnabled);
78 
83  mitk::Geometry3D::Pointer InitializeWithImageGeometry(const mitk::BaseGeometry *geometry) const;
84  DataNode::Pointer m_BoundingBoxNode;
85  BoundingShapeInteractor::Pointer m_BoundingShapeInteractor;
86  };
87 }
88 #endif
#define MITKSEGMENTATION_EXPORT
BaseGeometry Describes the geometry of a data object.
Medical Segment Anything Model interactive 2D tool class.
void ClearPicks() override
Clears all picks and updates the preview.
void Deactivated() override
Called when the tool gets deactivated.
bool HasPicks() const override
Checks if any point exists in the either of the pointsets.
void OnRelease(StateMachineAction *, InteractionEvent *)
void OnDelete(StateMachineAction *, InteractionEvent *)
Deletes bounding box from the render window.
void Activated() override
Called when the tool gets activated.
const char * GetName() const override
Returns the name of this tool. Make it short!
void OnRenderWindowClicked(StateMachineAction *, InteractionEvent *interactionEvent)
Adds bounding box in the render window when clicked.
mitkClassMacro(MedSAMTool, SegmentAnythingTool)
void OnMove(StateMachineAction *, InteractionEvent *)
~MedSAMTool()=default
MedSAMTool()=default
void OnPrimaryButtonPressed(StateMachineAction *, InteractionEvent *)
std::string GetPointsAsCSVString(const mitk::BaseGeometry *baseGeometry) const override
Get the Points from positive and negative pointsets as csv string.
void ConnectActionsAndFunctions() override
Segment Anything Model interactive 2D tool class.
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Find image slices visible on a given plane.