Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkRegionGrowingTool_h_Included
18 #define mitkRegionGrowingTool_h_Included
19 
21 #include "mitkLegacyAdaptors.h"
23 #include <array>
24 
25 struct mitkIpPicDescriptor;
26 
27 namespace us
28 {
29  class ModuleResource;
30 }
31 
32 namespace mitk
33 {
60  {
61  public:
63  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
64 
65  virtual const char **GetXPM() const override;
66  virtual us::ModuleResource GetCursorIconResource() const override;
67  us::ModuleResource GetIconResource() const override;
68 
69  virtual const char *GetName() const override;
70 
71  protected:
72  RegionGrowingTool(); // purposely hidden
73  virtual ~RegionGrowingTool();
74 
75  void ConnectActionsAndFunctions() override;
76 
77  virtual void Activated() override;
78  virtual void Deactivated() override;
79 
84  virtual void OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent);
85 
89  virtual void OnMousePressedInside();
90 
95  virtual void OnMousePressedOutside(StateMachineAction *, InteractionEvent *interactionEvent);
96 
105  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
106 
110  virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent);
111 
116  template <typename TPixel, unsigned int imageDimension>
117  void GetNeighborhoodAverage(itk::Image<TPixel, imageDimension> *itkImage,
119  ScalarType *result,
120  unsigned int neighborhood = 1);
121 
125  template <typename TPixel, unsigned int imageDimension>
126  void IsInsideSegmentation(itk::Image<TPixel, imageDimension> *itkImage,
128  bool *result);
129 
133  template <typename TPixel, unsigned int imageDimension>
134  void StartRegionGrowing(itk::Image<TPixel, imageDimension> *itkImage,
135  itk::Index<imageDimension> seedPoint,
136  std::array<ScalarType, 2> thresholds,
137  mitk::Image::Pointer &outputImage);
138 
141 
144  std::array<ScalarType, 2> m_Thresholds;
145  std::array<ScalarType, 2> m_InitialThresholds;
149 
150  private:
151  ScalarType m_VisibleWindow;
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
#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...
virtual void ConnectActionsAndFunctions() override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
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. ...