ITK  5.2.0
Insight Toolkit
itkCurvatureFlowFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkCurvatureFlowFunction_h
19 #define itkCurvatureFlowFunction_h
20 
22 #include "itkMacro.h"
23 
24 namespace itk
25 {
43 template <typename TImage>
44 class ITK_TEMPLATE_EXPORT CurvatureFlowFunction : public FiniteDifferenceFunction<TImage>
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_ASSIGN(CurvatureFlowFunction);
48 
54 
56  itkNewMacro(Self);
57 
60 
62  using ImageType = typename Superclass::ImageType;
63  using PixelType = typename Superclass::PixelType;
71 
73  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
74 
86  ComputeGlobalTimeStep(void * GlobalData) const override;
87 
93  void *
94  GetGlobalDataPointer() const override
95  {
96  auto * ans = new GlobalDataStruct();
97 
98  ans->m_MaxChange = NumericTraits<ScalarValueType>::ZeroValue();
99  return ans;
100  }
101 
106  void
107  ReleaseGlobalDataPointer(void * GlobalData) const override
108  {
109  delete (GlobalDataStruct *)GlobalData;
110  }
111 
113  void
115  {
116  m_TimeStep = t;
117  }
118 
120  const TimeStepType &
121  GetTimeStep() const
122  {
123  return m_TimeStep;
124  }
125 
128  PixelType
129  ComputeUpdate(const NeighborhoodType & neighborhood,
130  void * globalData,
131  const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
132 
133 protected:
135 
138  struct GlobalDataStruct
139  {
140  GlobalDataStruct() { m_MaxChange = NumericTraits<ScalarValueType>::ZeroValue(); }
141 
142  ~GlobalDataStruct() = default;
143 
144  ScalarValueType m_MaxChange;
145  };
147 
148  CurvatureFlowFunction();
149  ~CurvatureFlowFunction() override = default;
150 
151 private:
153 };
154 } // end namespace itk
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 # include "itkCurvatureFlowFunction.hxx"
158 #endif
159 
160 #endif
itk::FiniteDifferenceFunction< TImage >::RadiusType
typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::CurvatureFlowFunction::PixelType
typename Superclass::PixelType PixelType
Definition: itkCurvatureFlowFunction.h:63
itk::CurvatureFlowFunction::GetTimeStep
const TimeStepType & GetTimeStep() const
Definition: itkCurvatureFlowFunction.h:121
itk::CurvatureFlowFunction::ScalarValueType
PixelType ScalarValueType
Definition: itkCurvatureFlowFunction.h:65
itk::CurvatureFlowFunction::NeighborhoodType
typename Superclass::NeighborhoodType NeighborhoodType
Definition: itkCurvatureFlowFunction.h:67
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::FiniteDifferenceFunction< TImage >::PixelRealType
double PixelRealType
Definition: itkFiniteDifferenceFunction.h:84
itk::SmartPointer< Self >
itk::CurvatureFlowFunction::RadiusType
typename Superclass::RadiusType RadiusType
Definition: itkCurvatureFlowFunction.h:64
itk::FiniteDifferenceFunction< TImage >::ImageType
TImage ImageType
Definition: itkFiniteDifferenceFunction.h:82
itkFiniteDifferenceFunction.h
itk::CurvatureFlowFunction::TimeStepType
typename Superclass::TimeStepType TimeStepType
Definition: itkCurvatureFlowFunction.h:70
itk::CurvatureFlowFunction::NeighborhoodScalesType
typename Superclass::NeighborhoodScalesType NeighborhoodScalesType
Definition: itkCurvatureFlowFunction.h:68
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkMacro.h
itk::CurvatureFlowFunction
This class encapsulate the finite difference equation which drives a curvature flow denoising algorit...
Definition: itkCurvatureFlowFunction.h:44
itk::FiniteDifferenceFunction< TImage >::PixelType
typename ImageType::PixelType PixelType
Definition: itkFiniteDifferenceFunction.h:83
itk::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::CurvatureFlowFunction::GetGlobalDataPointer
void * GetGlobalDataPointer() const override
Definition: itkCurvatureFlowFunction.h:94
itk::CurvatureFlowFunction::ImageType
typename Superclass::ImageType ImageType
Definition: itkCurvatureFlowFunction.h:62
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:50
itk::CurvatureFlowFunction::SetTimeStep
void SetTimeStep(const TimeStepType &t)
Definition: itkCurvatureFlowFunction.h:114
itk::CurvatureFlowFunction::FloatOffsetType
typename Superclass::FloatOffsetType FloatOffsetType
Definition: itkCurvatureFlowFunction.h:69
itk::CurvatureFlowFunction::ReleaseGlobalDataPointer
void ReleaseGlobalDataPointer(void *GlobalData) const override
Definition: itkCurvatureFlowFunction.h:107
itk::FiniteDifferenceFunction
Definition: itkFiniteDifferenceFunction.h:66
itk::CurvatureFlowFunction::PixelRealType
typename Superclass::PixelRealType PixelRealType
Definition: itkCurvatureFlowFunction.h:66
itk::CurvatureFlowFunction::m_TimeStep
TimeStepType m_TimeStep
Definition: itkCurvatureFlowFunction.h:152
itk::FiniteDifferenceFunction< TImage >::TimeStepType
double TimeStepType
Definition: itkFiniteDifferenceFunction.h:90