Medical Imaging Interaction Toolkit  2018.4.99-c670e289
Medical Imaging Interaction Toolkit
mitkWatershedTool.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 mitkWatershedTool_h_Included
14 #define mitkWatershedTool_h_Included
15 
17 #include "mitkCommon.h"
19 
20 namespace us
21 {
22  class ModuleResource;
23 }
24 
25 namespace mitk
26 {
38  {
39  public:
41  itkFactorylessNewMacro(Self);
42  itkCloneMacro(Self);
43 
44  const char** GetXPM() const override;
45  const char* GetName() const override;
46  us::ModuleResource GetIconResource() const override;
47 
48  void Activated() override;
49 
50  itkSetMacro(Threshold, double);
51  itkGetConstMacro(Threshold, double);
52 
53  itkSetMacro(Level, double);
54  itkGetConstMacro(Level, double);
55 
56  protected:
57  WatershedTool() = default;
58  ~WatershedTool() = default;
59 
60  LabelSetImage::Pointer ComputeMLPreview(const Image* inputAtTimeStep, TimeStepType timeStep) override;
61 
63  double m_Threshold = 0.0;
65  double m_Level = 0.0;
66 
67 private:
74  template <typename TPixel, unsigned int VImageDimension>
75  void ITKWatershed(const itk::Image<TPixel, VImageDimension>* originalImage, itk::SmartPointer<mitk::Image>& segmentation, bool inputChanged);
76 
77  itk::ProcessObject::Pointer m_MagFilter;
78  itk::ProcessObject::Pointer m_WatershedFilter;
79  mitk::Image::ConstPointer m_LastFilterInput;
80  };
81 
82 } // namespace
83 
84 #endif
Simple watershed segmentation tool.
Base class for any auto segmentation tool that provides a preview of the new segmentation and generat...
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:73
std::vcl_size_t TimeStepType
Super-class that provides the functionality of a StateMachine to DataInteractors. ...