ITK  6.0.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  * https://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_MOVE(CurvatureFlowFunction);
48 
54 
56  itkNewMacro(Self);
57 
59  itkOverrideGetNameOfClassMacro(CurvatureFlowFunction);
60 
62  using typename Superclass::ImageType;
63  using typename Superclass::PixelType;
64  using typename Superclass::RadiusType;
66  using typename Superclass::PixelRealType;
67  using typename Superclass::NeighborhoodType;
69  using typename Superclass::FloatOffsetType;
70  using typename Superclass::TimeStepType;
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 = ScalarValueType{};
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 
127  PixelType
128  ComputeUpdate(const NeighborhoodType & it,
129  void * globalData,
130  const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
131 
132 protected:
134 
137  struct GlobalDataStruct
138  {
139  GlobalDataStruct() { m_MaxChange = ScalarValueType{}; }
140 
141  ~GlobalDataStruct() = default;
142 
143  ScalarValueType m_MaxChange;
144  };
146 
147  CurvatureFlowFunction();
148  ~CurvatureFlowFunction() override = default;
149 
150 private:
151  TimeStepType m_TimeStep{};
152 };
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 # include "itkCurvatureFlowFunction.hxx"
157 #endif
158 
159 #endif
itk::FiniteDifferenceFunction< TImage >::RadiusType
typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::CurvatureFlowFunction::GetTimeStep
const TimeStepType & GetTimeStep() const
Definition: itkCurvatureFlowFunction.h:121
itk::CurvatureFlowFunction::ScalarValueType
PixelType ScalarValueType
Definition: itkCurvatureFlowFunction.h:65
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::FiniteDifferenceFunction< TImage >::ImageType
TImage ImageType
Definition: itkFiniteDifferenceFunction.h:82
itkFiniteDifferenceFunction.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
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
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::CurvatureFlowFunction::GetGlobalDataPointer
void * GetGlobalDataPointer() const override
Definition: itkCurvatureFlowFunction.h:94
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itk::CurvatureFlowFunction::SetTimeStep
void SetTimeStep(const TimeStepType &t)
Definition: itkCurvatureFlowFunction.h:114
itk::CurvatureFlowFunction::ReleaseGlobalDataPointer
void ReleaseGlobalDataPointer(void *GlobalData) const override
Definition: itkCurvatureFlowFunction.h:107
itk::FiniteDifferenceFunction
Definition: itkFiniteDifferenceFunction.h:66
itk::FiniteDifferenceFunction< TImage >::TimeStepType
double TimeStepType
Definition: itkFiniteDifferenceFunction.h:90