ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkCurvatureFlowFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
42 template< typename TImage >
43 class ITK_TEMPLATE_EXPORT CurvatureFlowFunction:
44  public FiniteDifferenceFunction< TImage >
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_ASSIGN(CurvatureFlowFunction);
48 
54 
56  itkNewMacro(Self);
57 
59  itkTypeMacro(CurvatureFlowFunction,
61 
63  using ImageType = typename Superclass::ImageType;
64  using PixelType = typename Superclass::PixelType;
72 
74  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
75 
86  TimeStepType ComputeGlobalTimeStep(void *GlobalData) const override;
87 
93  void * GetGlobalDataPointer() const override
94  {
95  auto * ans = new GlobalDataStruct();
96 
98  return ans;
99  }
100 
105  void ReleaseGlobalDataPointer(void *GlobalData) const override
106  { delete (GlobalDataStruct *)GlobalData; }
107 
109  void SetTimeStep(const TimeStepType & t)
110  { m_TimeStep = t; }
111 
113  const TimeStepType & GetTimeStep() const
114  { return m_TimeStep; }
115 
118  PixelType ComputeUpdate(const NeighborhoodType & neighborhood,
119  void *globalData,
120  const FloatOffsetType & offset = FloatOffsetType(0.0)
121  ) override;
122 
123 protected:
124 
129  struct GlobalDataStruct {
130  GlobalDataStruct()
131  {
133  }
134 
135  ~GlobalDataStruct() = default;
136 
137  ScalarValueType m_MaxChange;
138  };
140 
141  CurvatureFlowFunction();
142  ~CurvatureFlowFunction() override = default;
143 
144 private:
146 };
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkCurvatureFlowFunction.hxx"
151 #endif
152 
153 #endif
Light weight base class for most itk classes.
void * GetGlobalDataPointer() const override
Define numeric traits for std::vector.
typename Superclass::NeighborhoodType NeighborhoodType
typename Superclass::TimeStepType TimeStepType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename Superclass::ImageType ImageType
typename Superclass::PixelRealType PixelRealType
typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
typename Superclass::RadiusType RadiusType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
void SetTimeStep(const TimeStepType &t)
typename Superclass::FloatOffsetType FloatOffsetType
void ReleaseGlobalDataPointer(void *GlobalData) const override
This class encapsulate the finite difference equation which drives a curvature flow denoising algorit...
const TimeStepType & GetTimeStep() const
typename Superclass::PixelType PixelType
typename Superclass::NeighborhoodScalesType NeighborhoodScalesType