Medical Imaging Interaction Toolkit  2018.4.99-c670e289
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"
21 
22 #include "itkImage.h"
23 #include "itkFastMarchingImageFilter.h"
24 
26 
27 namespace us
28 {
29  class ModuleResource;
30 }
31 
32 namespace mitk
33 {
45  {
46  public:
48  itkFactorylessNewMacro(Self);
49  itkCloneMacro(Self);
50 
51  bool CanHandle(const BaseData* referenceData, const BaseData* workingData) const override;
52 
53  /* icon stuff */
54  const char **GetXPM() const override;
55  const char *GetName() const override;
56  us::ModuleResource GetIconResource() const override;
57 
58  void Activated() override;
59  void Deactivated() override;
60 
62  void SetUpperThreshold(double);
63 
65  void SetLowerThreshold(double);
66 
68  void SetStoppingValue(double);
69 
71  void SetSigma(double);
72 
74  void SetAlpha(double);
75 
77  void SetBeta(double);
78 
80  void ClearSeeds();
81 
82  protected:
84  ~FastMarchingTool3D() override;
85 
87  virtual void OnAddPoint();
88 
90  virtual void OnDelete();
91 
92  void UpdatePrepare() override;
93  void UpdateCleanUp() override;
94  void DoUpdatePreview(const Image* inputAtTimeStep, Image* previewImage, TimeStepType timeStep) override;
95 
96  template <typename TPixel, unsigned int VImageDimension>
97  void DoITKFastMarching(const itk::Image<TPixel, VImageDimension>* inputImage,
98  mitk::Image* segmentation, unsigned int timeStep);
99 
100  float m_LowerThreshold; // used in Threshold filter
101  float m_UpperThreshold; // used in Threshold filter
102  float m_StoppingValue; // used in Fast Marching filter
103  float m_Sigma; // used in GradientMagnitude filter
104  float m_Alpha; // used in Sigmoid filter
105  float m_Beta; // used in Sigmoid filter
106 
107  typedef float InternalPixelType;
108  typedef itk::Image<InternalPixelType, 3> InternalImageType;
109  typedef itk::FastMarchingImageFilter<InternalImageType, InternalImageType> FastMarchingFilterType;
110  typedef FastMarchingFilterType::NodeContainer NodeContainer;
111  typedef FastMarchingFilterType::NodeType NodeType;
112 
113  NodeContainer::Pointer m_SeedContainer; // seed points for FastMarching
114 
115  mitk::DataNode::Pointer m_SeedsAsPointSetNode; // used to visualize the seed points
120  };
121 
122 } // namespace
123 
124 #endif
FastMarchingFilterType::NodeContainer NodeContainer
Base of all data objects.
Definition: mitkBaseData.h:42
itk::FastMarchingImageFilter< InternalImageType, InternalImageType > FastMarchingFilterType
FastMarching semgentation tool.
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
mitk::DataNode::Pointer m_SeedsAsPointSetNode
mitk::PointSet::Pointer m_SeedsAsPointSet
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:73
std::vcl_size_t TimeStepType
FastMarchingFilterType::NodeType NodeType
mitk::PointSetDataInteractor::Pointer m_SeedPointInteractor
itk::Image< InternalPixelType, 3 > InternalImageType
NodeContainer::Pointer m_SeedContainer
Base class for any auto segmentation tool that provides a preview of the new segmentation.
Super-class that provides the functionality of a StateMachine to DataInteractors. ...