ITK  4.9.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 >
44  public FiniteDifferenceFunction< TImage >
45 {
46 public:
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(CurvatureFlowFunction,
59 
61  typedef typename Superclass::ImageType ImageType;
62  typedef typename Superclass::PixelType PixelType;
70 
72  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
73 
84  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const ITK_OVERRIDE;
85 
91  virtual void * GetGlobalDataPointer() const ITK_OVERRIDE
92  {
93  GlobalDataStruct *ans = new GlobalDataStruct();
94 
96  return ans;
97  }
98 
103  virtual void ReleaseGlobalDataPointer(void *GlobalData) const ITK_OVERRIDE
104  { delete (GlobalDataStruct *)GlobalData; }
105 
107  void SetTimeStep(const TimeStepType & t)
108  { m_TimeStep = t; }
109 
111  const TimeStepType & GetTimeStep() const
112  { return m_TimeStep; }
113 
116  virtual PixelType ComputeUpdate(const NeighborhoodType & neighborhood,
117  void *globalData,
118  const FloatOffsetType & offset = FloatOffsetType(0.0)
119  ) ITK_OVERRIDE;
120 
121 protected:
122 
127  struct GlobalDataStruct {
128  GlobalDataStruct()
129  {
131  }
132 
133  ~GlobalDataStruct() {}
134 
135  ScalarValueType m_MaxChange;
136  };
138 
141 
142 private:
143  CurvatureFlowFunction(const Self &) ITK_DELETE_FUNCTION;
144  void operator=(const Self &) ITK_DELETE_FUNCTION;
145 
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkCurvatureFlowFunction.hxx"
152 #endif
153 
154 #endif
Superclass::FloatOffsetType FloatOffsetType
virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
Superclass::PixelRealType PixelRealType
Light weight base class for most itk classes.
virtual void * GetGlobalDataPointer() const override
Superclass::NeighborhoodScalesType NeighborhoodScalesType
ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
static const unsigned int ImageDimension
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
void SetTimeStep(const TimeStepType &t)
This class encapsulate the finite difference equation which drives a curvature flow denoising algorit...
const TimeStepType & GetTimeStep() const
Superclass::RadiusType RadiusType
Superclass::TimeStepType TimeStepType
FiniteDifferenceFunction< TImage > Superclass
Superclass::NeighborhoodType NeighborhoodType
SmartPointer< const Self > ConstPointer
virtual void ReleaseGlobalDataPointer(void *GlobalData) const override
virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const override