Medical Imaging Interaction Toolkit  2021.10.00
Medical Imaging Interaction Toolkit
mitkFastMarchingBaseTool.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 mitkFastMarchingBaseTool_h_Included
14 #define mitkFastMarchingBaseTool_h_Included
15 
17 #include "mitkDataNode.h"
18 #include "mitkPointSet.h"
20 #include "mitkToolCommand.h"
21 
22 #include "itkImage.h"
23 
25 
26 namespace us
27 {
28  class ModuleResource;
29 }
30 
31 namespace mitk
32 {
44  {
45  public:
47 
48  bool CanHandle(const BaseData* referenceData, const BaseData* workingData) const override;
49 
50  /* icon stuff */
51  const char **GetXPM() const override;
52  us::ModuleResource GetCursorIconResource() const override;
53  us::ModuleResource GetIconResource() const override;
54 
55  void Activated() override;
56  void Deactivated() override;
57 
59  void SetUpperThreshold(double);
60 
62  void SetLowerThreshold(double);
63 
65  void SetStoppingValue(double);
66 
68  void SetSigma(double);
69 
71  void SetAlpha(double);
72 
74  void SetBeta(double);
75 
77  void ClearSeeds();
78 
79 
80  protected:
81  FastMarchingBaseTool(unsigned int toolDim);
82  ~FastMarchingBaseTool() override;
83 
84  void ConnectActionsAndFunctions() override;
85 
87  virtual void OnAddPoint(StateMachineAction*, InteractionEvent* interactionEvent);
88 
90  virtual void OnDelete(StateMachineAction*, InteractionEvent* interactionEvent);
91 
92  void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, Image* previewImage, TimeStepType timeStep) override;
93 
94  template <typename TPixel, unsigned int VImageDimension>
95  void DoITKFastMarching(const itk::Image<TPixel, VImageDimension>* inputImage,
96  Image* segmentation, unsigned int timeStep, const BaseGeometry* inputGeometry);
97 
98  float m_LowerThreshold; // used in Threshold filter
99  float m_UpperThreshold; // used in Threshold filter
100  float m_StoppingValue; // used in Fast Marching filter
101  float m_Sigma; // used in GradientMagnitude filter
102  float m_Alpha; // used in Sigmoid filter
103  float m_Beta; // used in Sigmoid filter
104 
105  DataNode::Pointer m_SeedsAsPointSetNode; // used to visualize the seed points
107 
108  private:
111  unsigned int m_ToolDimension;
112 
113  };
114 
115 } // namespace
116 
117 #endif
Base of all data objects.
Definition: mitkBaseData.h:42
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
FastMarching semgentation tool base class.
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Image class for storing images.
Definition: mitkImage.h:69
std::vcl_size_t TimeStepType
Base class for any auto segmentation tool that provides a preview of the new segmentation.
BaseGeometry Describes the geometry of a data object.