Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitkFeedbackContourTool.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 mitkFeedbackContourTool_h
14 #define mitkFeedbackContourTool_h
15 
16 #include "mitkCommon.h"
17 #include "mitkContourModelUtils.h"
18 #include "mitkContourUtils.h" //TODO remove legacy support
19 #include "mitkImage.h"
20 #include "mitkSegTool2D.h"
22 
23 #include "mitkDataNode.h"
24 
25 #include "mitkImageCast.h"
26 
27 namespace mitk
28 {
50  {
51  public:
53 
54  protected:
55  FeedbackContourTool(); // purposely hidden
56  FeedbackContourTool(const char *); // purposely hidden
57  ~FeedbackContourTool() override;
58 
59  const ContourModel *GetFeedbackContour() const;
60 
64  void InitializeFeedbackContour(bool isClosed);
65 
67  void ClearsCurrentFeedbackContour(bool isClosed);
68 
72  void UpdateCurrentFeedbackContour(const ContourModel* sourceModel, TimeStepType sourceTimeStep = 0);
76  void UpdateFeedbackContour(const ContourModel* sourceModel, TimeStepType feedbackTimeStep, TimeStepType sourceTimeStep = 0);
77 
79  void AddVertexToCurrentFeedbackContour(const Point3D& point);
80 
82  void AddVertexToFeedbackContour(const Point3D& point, TimeStepType feedbackTimeStep);
83 
84  void SetFeedbackContourVisible(bool);
85 
87  void SetFeedbackContourColor(float r, float g, float b);
88  void SetFeedbackContourColorDefault();
89 
90  void Deactivated() override;
91 
92  void Activated() override;
93 
100  ContourModel::Pointer ProjectContourTo2DSlice(const Image *slice,
101  const ContourModel *contourIn3D);
102 
109  ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
110  const ContourModel *contourIn2D);
111 
118  void WriteBackFeedbackContourAsSegmentationResult(const InteractionPositionEvent* positionEvent, int paintingPixelValue, bool setInvisibleAfterSuccess = true);
119 
123  void FillContourInSlice(ContourModel *projectedContour, Image *sliceImage, int paintingPixelValue = 1);
124 
128  void FillContourInSlice(ContourModel *projectedContour,
129  unsigned int timeStep,
130  Image *sliceImage,
131  int paintingPixelValue = 1);
132 
133  private:
134  ContourModel::Pointer m_FeedbackContour;
135  DataNode::Pointer m_FeedbackContourNode;
136  bool m_FeedbackContourVisible;
137  };
138 
139 } // namespace
140 
141 #endif
mitkImage.h
mitkImageCast.h
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::SegTool2D
Abstract base class for segmentation tools.
Definition: mitkSegTool2D.h:56
mitk::InteractionPositionEvent
Super class for all position events.
Definition: mitkInteractionPositionEvent.h:36
mitk::FeedbackContourTool
Base class for tools that use a contour for feedback.
Definition: mitkFeedbackContourTool.h:49
mitk::BaseGeometry
BaseGeometry Describes the geometry of a data object.
Definition: mitkBaseGeometry.h:94
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
mitkCommon.h
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
mitkSegTool2D.h
mitkDataNode.h
mitkContourModelUtils.h
mitk::TimeStepType
std::size_t TimeStepType
Definition: mitkTimeGeometry.h:27
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MitkSegmentationExports.h
mitkContourUtils.h
mitk::BaseData::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkBaseData.h:46