Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkEditableContourTool.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 mitkEditableContourTool_h
14 #define mitkEditableContourTool_h
15 
17 
18 namespace mitk
19 {
28  {
29  public:
31 
33  virtual void ConfirmSegmentation(bool resetStatMachine = true);
34 
36  virtual void ClearContour();
37 
38  itkBooleanMacro(AutoConfirm);
39  itkSetMacro(AutoConfirm, bool);
40  itkGetMacro(AutoConfirm, bool);
41 
42  itkBooleanMacro(AddMode);
43  itkSetMacro(AddMode, bool);
44  itkGetMacro(AddMode, bool);
45 
46  /* Indicated if a contour is drawn, but not confirmed yet. This tool is in interactor mode
47  to allow users to edit the contour. This state can be reached if AutoConfirm is false, after the finalizing double
48  click before the contour is confirmed.*/
49  bool IsEditingContour() const;
50  /* Indicate if a contour is currently drawn by the user (state between the initializing double click and
51  the finalizing double click).*/
52  bool IsDrawingContour() const;
53 
54  protected:
56  ~EditableContourTool() override;
57 
58  void ConnectActionsAndFunctions() override;
59 
60  void Activated() override;
61  void Deactivated() override;
62 
63  virtual Point3D PrepareInitContour(const Point3D& clickedPoint);
64  virtual void FinalizePreviewContour(const Point3D& clickedPoint);
65  virtual void InitializePreviewContour(const Point3D& clickedPoint);
66  virtual void UpdatePreviewContour(const Point3D& clickedPoint);
67 
69  virtual void OnInitContour(StateMachineAction *, InteractionEvent *interactionEvent);
70 
72  virtual void OnAddPoint(StateMachineAction *, InteractionEvent *interactionEvent);
73 
75  virtual void OnDrawing(StateMachineAction *, InteractionEvent *interactionEvent);
76 
77  virtual void OnEndDrawing(StateMachineAction *, InteractionEvent *interactionEvent);
78 
80  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
81 
83  virtual void OnFinish(StateMachineAction *, InteractionEvent *interactionEvent);
84 
86  virtual bool OnCheckPlane(const InteractionEvent* interactionEvent);
87 
89  virtual bool OnCheckDistanceToControlPoint(const InteractionEvent* interactionEvent);
90 
92  virtual void FinishTool() = 0;
93 
94  void EnableContourInteraction(bool on);
95 
96  void ReleaseInteractors();
97 
98  virtual void ReleaseHelperObjects(bool includeWorkingContour = true);
99 
100  virtual void RemoveHelperObjectsFromDataStorage(bool includeWorkingContour = true);
101 
102  ContourModel::Pointer CreateNewContour() const;
103 
104  virtual void UpdateClosureContour(mitk::Point3D endpoint);
105 
106  mitk::ContourModel* GetContour();
107  const mitk::ContourModel* GetContour() const;
109 
112 
115 
117 
121 
123 
125 
127  bool m_AddMode;
128  };
129 }
130 
131 #endif
mitkFeedbackContourTool.h
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::EditableContourTool::m_ReferenceDataSlice
mitk::Image::Pointer m_ReferenceDataSlice
Definition: mitkEditableContourTool.h:120
itk::SmartPointer< Self >
mitk::EditableContourTool
Definition: mitkEditableContourTool.h:27
mitk::EditableContourTool::m_ContourNode
mitk::DataNode::Pointer m_ContourNode
Definition: mitkEditableContourTool.h:108
mitk::EditableContourTool::m_PreviewContourNode
mitk::DataNode::Pointer m_PreviewContourNode
Definition: mitkEditableContourTool.h:111
mitk::EditableContourTool::m_ClosureContour
mitk::ContourModel::Pointer m_ClosureContour
Definition: mitkEditableContourTool.h:113
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::EditableContourTool::m_ClosureContourNode
mitk::DataNode::Pointer m_ClosureContourNode
Definition: mitkEditableContourTool.h:114
mitk::EditableContourTool::m_PlaneGeometry
PlaneGeometry::ConstPointer m_PlaneGeometry
Definition: mitkEditableContourTool.h:122
mitk::FeedbackContourTool
Base class for tools that use a contour for feedback.
Definition: mitkFeedbackContourTool.h:49
mitk::EditableContourTool::m_ContourInteractor
mitk::DataInteractor::Pointer m_ContourInteractor
Definition: mitkEditableContourTool.h:124
mitk::Point< ScalarType, 3 >
mitk::ContourModel
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Definition: mitkContourModel.h:47
mitk::EditableContourTool::m_AddMode
bool m_AddMode
Definition: mitkEditableContourTool.h:127
mitk::EditableContourTool::m_PreviewContour
mitk::ContourModel::Pointer m_PreviewContour
Definition: mitkEditableContourTool.h:110
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
mitk::EditableContourTool::m_AutoConfirm
bool m_AutoConfirm
Definition: mitkEditableContourTool.h:126
mitk::StateMachineAction
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Definition: mitkStateMachineAction.h:30
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::EditableContourTool::m_CurrentRestrictedArea
mitk::ContourModel::Pointer m_CurrentRestrictedArea
Definition: mitkEditableContourTool.h:116
mitk::BaseData::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkBaseData.h:46