Medical Imaging Interaction Toolkit  2018.4.99-4c24e3cb
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) itkCloneMacro(Self)
57 
58  const char **GetXPM() const override;
59  us::ModuleResource GetCursorIconResource() const override;
60  us::ModuleResource GetIconResource() const override;
61 
62  const char *GetName() const override;
63 
64  protected:
65  RegionGrowingTool(); // purposely hidden
66  ~RegionGrowingTool() override;
67 
68  void ConnectActionsAndFunctions() override;
69 
70  void Activated() override;
71  void Deactivated() override;
72 
77  virtual void OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent);
78 
82  virtual void OnMousePressedInside();
83 
88  virtual void OnMousePressedOutside(StateMachineAction *, InteractionEvent *interactionEvent);
89 
98  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
99 
103  virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent);
104 
109  template <typename TPixel, unsigned int imageDimension>
110  void GetNeighborhoodAverage(itk::Image<TPixel, imageDimension> *itkImage,
112  ScalarType *result,
113  unsigned int neighborhood = 1);
114 
118  template <typename TPixel, unsigned int imageDimension>
119  void IsInsideSegmentation(itk::Image<TPixel, imageDimension> *itkImage,
121  bool *result);
122 
126  template <typename TPixel, unsigned int imageDimension>
127  void StartRegionGrowing(itk::Image<TPixel, imageDimension> *itkImage,
128  itk::Index<imageDimension> seedPoint,
129  std::array<ScalarType, 2> thresholds,
130  mitk::Image::Pointer &outputImage);
131 
134 
137  std::array<ScalarType, 2> m_Thresholds;
138  std::array<ScalarType, 2> m_InitialThresholds;
142 
143  private:
144  ScalarType m_MouseDistanceScaleFactor;
145  int m_PaintingPixelValue;
146  bool m_FillFeedbackContour;
147  int m_ConnectedComponentValue;
148  };
149 
150 } // namespace
151 
152 #endif
std::array< ScalarType, 2 > m_InitialThresholds
double ScalarType
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
std::array< ScalarType, 2 > m_Thresholds
void StartRegionGrowing(itk::Image< TPixel, VImageDimension > *itkImage, mitk::Image::Pointer &result)
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.
static std::string GetName(std::string fileName, std::string suffix)
Super-class that provides the functionality of a StateMachine to DataInteractors. ...