Medical Imaging Interaction Toolkit  2018.4.99-68f53314
Medical Imaging Interaction Toolkit
mitkRegionGrowingTool.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 mitkRegionGrowingTool_h_Included
14 #define mitkRegionGrowingTool_h_Included
15 
18 #include <array>
19 
20 namespace us
21 {
22  class ModuleResource;
23 }
24 
25 namespace mitk
26 {
53  {
54  public:
56  itkFactorylessNewMacro(Self);
57  itkCloneMacro(Self);
58 
59  const char **GetXPM() const override;
60  us::ModuleResource GetCursorIconResource() const override;
61  us::ModuleResource GetIconResource() const override;
62 
63  const char *GetName() const override;
64 
65  protected:
66  RegionGrowingTool(); // purposely hidden
67  ~RegionGrowingTool() override;
68 
69  void ConnectActionsAndFunctions() override;
70 
71  void Activated() override;
72  void Deactivated() override;
73 
78  virtual void OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent);
79 
83  virtual void OnMousePressedInside();
84 
89  virtual void OnMousePressedOutside(StateMachineAction *, InteractionEvent *interactionEvent);
90 
99  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
100 
104  virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent);
105 
110  template <typename TPixel, unsigned int imageDimension>
111  void GetNeighborhoodAverage(const itk::Image<TPixel, imageDimension> *itkImage,
112  const itk::Index<imageDimension>& index,
113  ScalarType *result,
114  unsigned int neighborhood = 1);
115 
119  template <typename TPixel, unsigned int imageDimension>
120  void IsInsideSegmentation(const itk::Image<TPixel, imageDimension> *itkImage,
121  const itk::Index<imageDimension>& index,
122  bool *result);
123 
127  template <typename TPixel, unsigned int imageDimension>
128  void StartRegionGrowing(const itk::Image<TPixel, imageDimension> *itkImage,
129  const itk::Index<imageDimension>& seedPoint,
130  const std::array<ScalarType, 2>& thresholds,
131  mitk::Image::Pointer &outputImage);
132 
136  template <typename TPixel, unsigned int imageDimension>
137  void CalculateInitialThresholds(const itk::Image<TPixel, imageDimension>* itkImage);
138 
141 
144  std::array<ScalarType, 2> m_ThresholdExtrema;
145  std::array<ScalarType, 2> m_Thresholds;
146  std::array<ScalarType, 2> m_InitialThresholds;
150 
151  private:
152  ScalarType m_MouseDistanceScaleFactor;
153  int m_PaintingPixelValue;
154  bool m_FillFeedbackContour;
155  int m_ConnectedComponentValue;
156  };
157 
158 } // namespace
159 
160 #endif
std::array< ScalarType, 2 > m_InitialThresholds
double ScalarType
std::array< ScalarType, 2 > m_ThresholdExtrema
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
std::array< ScalarType, 2 > m_Thresholds
A slice based region growing tool.
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Base class for tools that use a contour for feedback.
Super-class that provides the functionality of a StateMachine to DataInteractors. ...