ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkFiniteDifferenceFunction.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 __itkFiniteDifferenceFunction_h
19 #define __itkFiniteDifferenceFunction_h
20 
21 #include "itkLightObject.h"
23 #include "itkVector.h"
24 
25 namespace itk
26 {
65 template< class TImageType >
66 class ITK_EXPORT FiniteDifferenceFunction:public LightObject
67 {
68 public:
69 
75 
78 
80  typedef TImageType ImageType;
81  typedef typename ImageType::PixelType PixelType;
82  typedef double PixelRealType;
83 
85  itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
86 
88  typedef double TimeStepType;
89 
94 
97 
101 
105 
109 
119  virtual void InitializeIteration() {}
120 
134 #if !defined( CABLE_CONFIGURATION )
135  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
136  void *globalData,
137  const FloatOffsetType & offset = FloatOffsetType(0.0) ) = 0;
138 
139 #endif
140 
143  void SetRadius(const RadiusType & r);
144 
147  const RadiusType & GetRadius() const;
148 
152  void SetScaleCoefficients(PixelRealType vals[ImageDimension]);
153 
155  void GetScaleCoefficients(PixelRealType vals[ImageDimension]) const;
156 
160  const NeighborhoodScalesType ComputeNeighborhoodScales() const;
161 
168  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const = 0;
169 
177  virtual void * GetGlobalDataPointer() const = 0;
178 
184  virtual void ReleaseGlobalDataPointer(void *GlobalData) const = 0;
185 
186 protected:
189 
190  void PrintSelf(std::ostream & os, Indent indent) const;
191 
193  PixelRealType m_ScaleCoefficients[ImageDimension];
194 
195 private:
196  FiniteDifferenceFunction(const Self &); //purposely not implemented
197  void operator=(const Self &); //purposely not implemented
198 };
199 } // end namespace itk
200 
201 #ifndef ITK_MANUAL_INSTANTIATION
202 #include "itkFiniteDifferenceFunction.hxx"
203 #endif
204 
205 #endif
206