Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
14 #define mitkRegionGrowingTool_h
15 
18 #include <array>
19 
20 namespace us
21 {
22  class ModuleResource;
23 }
24 
25 namespace mitk
26 {
50  {
51  public:
53  itkFactorylessNewMacro(Self);
54  itkCloneMacro(Self);
55 
56  const char **GetXPM() const override;
57  us::ModuleResource GetCursorIconResource() const override;
58  us::ModuleResource GetIconResource() const override;
59 
60  const char *GetName() const override;
61 
62  protected:
63  RegionGrowingTool(); // purposely hidden
64  ~RegionGrowingTool() override;
65 
66  void ConnectActionsAndFunctions() override;
67 
68  void Activated() override;
69  void Deactivated() override;
70 
75  virtual void OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent);
76 
85  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
86 
90  virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent);
91 
96  template <typename TPixel, unsigned int imageDimension>
97  void GetNeighborhoodAverage(const itk::Image<TPixel, imageDimension> *itkImage,
98  const itk::Index<imageDimension>& index,
99  ScalarType *result,
100  unsigned int neighborhood = 1);
101 
105  template <typename TPixel, unsigned int imageDimension>
106  void StartRegionGrowing(const itk::Image<TPixel, imageDimension> *itkImage,
107  const itk::Index<imageDimension>& seedPoint,
108  const std::array<ScalarType, 2>& thresholds,
109  mitk::Image::Pointer &outputImage);
110 
114  template <typename TPixel, unsigned int imageDimension>
115  void CalculateInitialThresholds(const itk::Image<TPixel, imageDimension>* itkImage);
116 
119 
122  std::array<ScalarType, 2> m_ThresholdExtrema;
123  std::array<ScalarType, 2> m_Thresholds;
124  std::array<ScalarType, 2> m_InitialThresholds;
128 
129  private:
130  ScalarType m_MouseDistanceScaleFactor;
131  int m_PaintingPixelValue;
132  bool m_FillFeedbackContour;
133  int m_ConnectedComponentValue;
134  };
135 
136 } // namespace
137 
138 #endif
mitkFeedbackContourTool.h
mitk::RegionGrowingTool::m_WorkingSlice
Image::Pointer m_WorkingSlice
Definition: mitkRegionGrowingTool.h:118
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::RegionGrowingTool::m_SeedPoint
itk::Index< 3 > m_SeedPoint
Definition: mitkRegionGrowingTool.h:121
us
Definition: mitkAbstractFileReader.h:29
itk::SmartPointer< Self >
mitk::RegionGrowingTool::m_InitialThresholds
std::array< ScalarType, 2 > m_InitialThresholds
Definition: mitkRegionGrowingTool.h:124
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::EventStateMachine
‍**
Definition: mitkEventStateMachine.h:111
mitk::RegionGrowingTool::m_Thresholds
std::array< ScalarType, 2 > m_Thresholds
Definition: mitkRegionGrowingTool.h:123
mitk::FeedbackContourTool
Base class for tools that use a contour for feedback.
Definition: mitkFeedbackContourTool.h:49
mitk::Point< int, 2 >
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
mitk::RegionGrowingTool
A slice based region growing tool.
Definition: mitkRegionGrowingTool.h:49
us::ModuleResource
Definition: usModuleResource.h:55
mitk::RegionGrowingTool::m_SeedValue
ScalarType m_SeedValue
Definition: mitkRegionGrowingTool.h:120
mitk::RegionGrowingTool::m_ScreenXDifference
int m_ScreenXDifference
Definition: mitkRegionGrowingTool.h:127
mitk::StateMachineAction
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Definition: mitkStateMachineAction.h:30
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::RegionGrowingTool::m_ReferenceSlice
Image::Pointer m_ReferenceSlice
Definition: mitkRegionGrowingTool.h:117
mitk::RegionGrowingTool::m_ThresholdExtrema
std::array< ScalarType, 2 > m_ThresholdExtrema
Definition: mitkRegionGrowingTool.h:122
MitkSegmentationExports.h
itk::Index
Definition: mitkGrabCutOpenCVImageFilter.h:32
mitk::RegionGrowingTool::m_LastScreenPosition
Point2I m_LastScreenPosition
Definition: mitkRegionGrowingTool.h:125
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20
mitk::RegionGrowingTool::m_ScreenYDifference
int m_ScreenYDifference
Definition: mitkRegionGrowingTool.h:126