ITK  4.2.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 
157  const NeighborhoodScalesType ComputeNeighborhoodScales() const;
158 
165  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const = 0;
166 
174  virtual void * GetGlobalDataPointer() const = 0;
175 
181  virtual void ReleaseGlobalDataPointer(void *GlobalData) const = 0;
182 
183 protected:
186 
187  void PrintSelf(std::ostream & os, Indent indent) const;
188 
190  PixelRealType m_ScaleCoefficients[ImageDimension];
191 private:
192  FiniteDifferenceFunction(const Self &); //purposely not implemented
193  void operator=(const Self &); //purposely not implemented
194 };
195 } // end namespace itk
196 
197 // Define instantiation macro for this template.
198 #define ITK_TEMPLATE_FiniteDifferenceFunction(_, EXPORT, TypeX, TypeY) \
199  namespace itk \
200  { \
201  _( 1 ( class EXPORT FiniteDifferenceFunction< ITK_TEMPLATE_1 TypeX > ) ) \
202  namespace Templates \
203  { \
204  typedef FiniteDifferenceFunction< ITK_TEMPLATE_1 TypeX > FiniteDifferenceFunction##TypeY; \
205  } \
206  }
207 
208 #if ITK_TEMPLATE_EXPLICIT
209 #include "Templates/itkFiniteDifferenceFunction+-.h"
210 #endif
211 
212 #if ITK_TEMPLATE_TXX
213 #include "itkFiniteDifferenceFunction.hxx"
214 #endif
215 
216 #endif
217