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