ITK  4.3.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< class TImage >
43 class ITK_EXPORT CurvatureFlowFunction:
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;
85 
91  virtual void * GetGlobalDataPointer() const
92  {
93  GlobalDataStruct *ans = new GlobalDataStruct();
94 
95  ans->m_MaxChange = NumericTraits< ScalarValueType >::Zero;
96  return ans;
97  }
98 
103  virtual void ReleaseGlobalDataPointer(void *GlobalData) const
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  );
120 
121 protected:
122 
127  struct GlobalDataStruct {
128  GlobalDataStruct()
129  {
131  }
132 
133  ~GlobalDataStruct() {}
134 
135  ScalarValueType m_MaxChange;
136  };
138 
139  CurvatureFlowFunction();
141 
142 private:
143  CurvatureFlowFunction(const Self &); //purposely not implemented
144  void operator=(const Self &); //purposely not implemented
145 
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkCurvatureFlowFunction.hxx"
152 #endif
153 
154 #endif
155