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
24namespace itk
25{
43template <typename TImage>
44class ITK_TEMPLATE_EXPORT CurvatureFlowFunction : public FiniteDifferenceFunction<TImage>
45{
46public:
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 &
122 {
123 return m_TimeStep;
124 }
125
127 PixelType
129 void * globalData,
130 const FloatOffsetType & offset = FloatOffsetType(0.0)) override;
131
132protected:
134
137 struct GlobalDataStruct
138 {
139 GlobalDataStruct() { m_MaxChange = ScalarValueType{}; }
140
141 ~GlobalDataStruct() = default;
142
143 ScalarValueType m_MaxChange;
144 };
146
148 ~CurvatureFlowFunction() override = default;
149
150private:
151 TimeStepType m_TimeStep{};
152};
153} // end namespace itk
154
155#ifndef ITK_MANUAL_INSTANTIATION
156# include "itkCurvatureFlowFunction.hxx"
157#endif
158
159#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
This class encapsulate the finite difference equation which drives a curvature flow denoising algorit...
void * GetGlobalDataPointer() const override
~CurvatureFlowFunction() override=default
const TimeStepType & GetTimeStep() const
TimeStepType ComputeGlobalTimeStep(void *GlobalData) const override
void ReleaseGlobalDataPointer(void *GlobalData) const override
PixelType ComputeUpdate(const NeighborhoodType &it, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
void SetTimeStep(const TimeStepType &t)
typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
Light weight base class for most itk classes.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....