Medical Imaging Interaction Toolkit  2021.10.00
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_Included
14 #define mitkFeedbackContourTool_h_Included
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
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Super class for all position events.
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Image class for storing images.
Definition: mitkImage.h:69
std::vcl_size_t TimeStepType
Base class for tools that use a contour for feedback.
Abstract base class for segmentation tools.
Definition: mitkSegTool2D.h:54
BaseGeometry Describes the geometry of a data object.