Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkContourModelLiveWireInteractor.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 mitkContourModelLiveWireInteractor_h
14 #define mitkContourModelLiveWireInteractor_h
15 
16 #include <mitkCommon.h>
19 
21 
22 namespace mitk
23 {
39  {
40  public:
42  itkFactorylessNewMacro(Self);
43  itkCloneMacro(Self);
44 
49  virtual void SetWorkingImage(mitk::Image *_arg);
50 
51  void ConnectActionsAndFunctions() override;
52 
53  protected:
56 
58  bool OnCheckPointClick(const InteractionEvent *interactionEvent) override;
59 
61  void OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent) override;
63  void OnAddPoint(StateMachineAction*, InteractionEvent* interactionEvent) override;
65  void OnDeletePoint(StateMachineAction *, InteractionEvent *interactionEvent) override;
67  void OnFinishEditing(StateMachineAction *, InteractionEvent *interactionEvent) override;
68 
71  const mitk::ContourModel::VertexType *nextPoint,
72  const mitk::ContourModel::VertexType *previousPoint,
73  int timestep);
76  mitk::ContourModel *contour,
77  int timestep);
78 
79  mitk::ImageLiveWireContourModelFilter::Pointer m_LiveWireFilter;
80  mitk::Image::Pointer m_WorkingSlice;
81 
84 
87 
88  std::vector<itk::Index<2>> m_ContourBeingModified;
89 
90  mitk::ContourModel::Pointer m_ContourLeft;
91  mitk::ContourModel::Pointer m_ContourRight;
92  };
93 
94 } // namespace mitk
95 
96 #endif
#define MITKSEGMENTATION_EXPORT
Interactor for editing contour model vertices by mouse interaction.
LiveWire-based contour model interactor for editing contour segments.
void SetRepulsivePoints(const mitk::ContourModel::VertexType *nextPoint, mitk::ContourModel *contour, int timestep)
Set repulsive points which should not be changed during editing of the contour.
mitk::ContourModel::VertexIterator m_NextActiveVertexDownIter
mitkClassMacro(ContourModelLiveWireInteractor, ContourModelInteractor)
void OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent) override
Update contour when point is moved.
bool OnCheckPointClick(const InteractionEvent *interactionEvent) override
Select/ add and select vertex to modify contour and prepare for modification of contour.
mitk::ContourModel::VertexIterator m_NextActiveVertexUpIter
virtual void SetWorkingImage(mitk::Image *_arg)
Sets the working image used for LiveWire cost computation.
void OnAddPoint(StateMachineAction *, InteractionEvent *interactionEvent) override
Add a new control point.
void OnDeletePoint(StateMachineAction *, InteractionEvent *interactionEvent) override
Delete selected vertex and recompute contour.
void SplitContourFromSelectedVertex(mitk::ContourModel *srcContour, const mitk::ContourModel::VertexType *nextPoint, const mitk::ContourModel::VertexType *previousPoint, int timestep)
Split contour into a part before the selected vertex and after the selected vertex.
mitk::ImageLiveWireContourModelFilter::Pointer m_LiveWireFilter
void OnFinishEditing(StateMachineAction *, InteractionEvent *interactionEvent) override
Finish modification of contour.
A time-resolved contour representation consisting of linked vertices in 3D space.
ContourElement::VertexIterator VertexIterator
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Base class for all interaction events in MITK.
Represents an action that is executed after a certain event in the state machine mechanism.
Find image slices visible on a given plane.
Represents a single vertex of a contour.