Medical Imaging Interaction Toolkit  2018.4.99-b585543d
Medical Imaging Interaction Toolkit
mitkFastMarchingTool3D.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 mitkFastMarchingTool3D_h_Included
14 #define mitkFastMarchingTool3D_h_Included
15 
17 #include "mitkDataNode.h"
18 #include "mitkPointSet.h"
20 #include "mitkToolCommand.h"
22 
23 #include "mitkMessage.h"
24 
25 #include "itkImage.h"
26 
27 // itk filter
28 #include "itkBinaryThresholdImageFilter.h"
29 #include "itkCurvatureAnisotropicDiffusionImageFilter.h"
30 #include "itkFastMarchingImageFilter.h"
31 #include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
32 #include "itkSigmoidImageFilter.h"
33 
34 namespace us
35 {
36  class ModuleResource;
37 }
38 
39 namespace mitk
40 {
52  {
53  mitkNewMessageMacro(Ready);
54 
55  public:
57  itkFactorylessNewMacro(Self);
58  itkCloneMacro(Self);
59 
60  /* typedefs for itk pipeline */
61  typedef float InternalPixelType;
62  typedef itk::Image<InternalPixelType, 3> InternalImageType;
64  typedef itk::Image<OutputPixelType, 3> OutputImageType;
65 
66  typedef itk::BinaryThresholdImageFilter<InternalImageType, OutputImageType> ThresholdingFilterType;
67  typedef itk::CurvatureAnisotropicDiffusionImageFilter<InternalImageType, InternalImageType> SmoothingFilterType;
68  typedef itk::GradientMagnitudeRecursiveGaussianImageFilter<InternalImageType, InternalImageType> GradientFilterType;
69  typedef itk::SigmoidImageFilter<InternalImageType, InternalImageType> SigmoidFilterType;
70  typedef itk::FastMarchingImageFilter<InternalImageType, InternalImageType> FastMarchingFilterType;
71  typedef FastMarchingFilterType::NodeContainer NodeContainer;
72  typedef FastMarchingFilterType::NodeType NodeType;
73 
74  bool CanHandle(BaseData *referenceData) const override;
75 
76  /* icon stuff */
77  const char **GetXPM() const override;
78  const char *GetName() const override;
79  us::ModuleResource GetIconResource() const override;
80 
82  void SetUpperThreshold(double);
83 
85  void SetLowerThreshold(double);
86 
88  void SetStoppingValue(double);
89 
91  void SetSigma(double);
92 
94  void SetAlpha(double);
95 
97  void SetBeta(double);
98 
100  virtual void ConfirmSegmentation();
101 
103  virtual void SetCurrentTimeStep(int t);
104 
106  void ClearSeeds();
107 
109  void Update();
110 
111  protected:
113  ~FastMarchingTool3D() override;
114 
115  void Activated() override;
116  void Deactivated() override;
117  virtual void Initialize();
118 
120  virtual void OnAddPoint();
121 
123  virtual void OnDelete();
124 
126  void Reset();
127 
129 
131 
133 
135 
136  float m_LowerThreshold; // used in Threshold filter
137  float m_UpperThreshold; // used in Threshold filter
138  float m_StoppingValue; // used in Fast Marching filter
139  float m_Sigma; // used in GradientMagnitude filter
140  float m_Alpha; // used in Sigmoid filter
141  float m_Beta; // used in Sigmoid filter
142 
143  NodeContainer::Pointer m_SeedContainer; // seed points for FastMarching
144 
145  InternalImageType::Pointer m_ReferenceImageAsITK; // the reference image as itk::Image
146 
147  mitk::DataNode::Pointer m_ResultImageNode; // holds the result as a preview image
148 
149  mitk::DataNode::Pointer m_SeedsAsPointSetNode; // used to visualize the seed points
154 
155  ThresholdingFilterType::Pointer m_ThresholdFilter;
156  SmoothingFilterType::Pointer m_SmoothFilter;
157  GradientFilterType::Pointer m_GradientMagnitudeFilter;
158  SigmoidFilterType::Pointer m_SigmoidFilter;
159  FastMarchingFilterType::Pointer m_FastMarchingFilter;
160  };
161 
162 } // namespace
163 
164 #endif
SigmoidFilterType::Pointer m_SigmoidFilter
FastMarchingFilterType::NodeContainer NodeContainer
SmoothingFilterType::Pointer m_SmoothFilter
Base of all data objects.
Definition: mitkBaseData.h:37
InternalImageType::Pointer m_ReferenceImageAsITK
itk::FastMarchingImageFilter< InternalImageType, InternalImageType > FastMarchingFilterType
mitk::ToolCommand::Pointer m_ProgressCommand
FastMarching semgentation tool.
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:31
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
mitk::DataNode::Pointer m_SeedsAsPointSetNode
itk::SigmoidImageFilter< InternalImageType, InternalImageType > SigmoidFilterType
#define mitkNewMessageMacro(msgHandleObject)
Definition: mitkMessage.h:24
mitk::Tool::DefaultSegmentationDataType OutputPixelType
mitk::PointSet::Pointer m_SeedsAsPointSet
mitk::DataNode::Pointer m_ResultImageNode
GradientFilterType::Pointer m_GradientMagnitudeFilter
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Superclass for tool that create a new segmentation without user interaction in render windows...
FastMarchingFilterType::NodeType NodeType
itk::CurvatureAnisotropicDiffusionImageFilter< InternalImageType, InternalImageType > SmoothingFilterType
mitk::PointSetDataInteractor::Pointer m_SeedPointInteractor
itk::GradientMagnitudeRecursiveGaussianImageFilter< InternalImageType, InternalImageType > GradientFilterType
itk::Image< InternalPixelType, 3 > InternalImageType
mitk::Label::PixelType DefaultSegmentationDataType
Definition: mitkTool.h:89
NodeContainer::Pointer m_SeedContainer
static std::string GetName(std::string fileName, std::string suffix)
itk::BinaryThresholdImageFilter< InternalImageType, OutputImageType > ThresholdingFilterType
itk::Image< OutputPixelType, 3 > OutputImageType
FastMarchingFilterType::Pointer m_FastMarchingFilter
ThresholdingFilterType::Pointer m_ThresholdFilter
Super-class that provides the functionality of a StateMachine to DataInteractors. ...