Orfeo Toolbox  3.16
itkFiniteDifferenceFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkFiniteDifferenceFunction.h,v $
5  Language: C++
6  Date: $Date: 2008-10-16 23:25:41 $
7  Version: $Revision: 1.21 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkFiniteDifferenceFunction_h
18 #define __itkFiniteDifferenceFunction_h
19 
20 #include "itkLightObject.h"
23 #include "itkVector.h"
24 #include "itkFixedArray.h"
25 
26 namespace itk {
27 
64 template<class TImageType>
66 {
67 public:
73 
76 
78  typedef TImageType ImageType;
79  typedef typename ImageType::PixelType PixelType;
80  typedef double PixelRealType;
81 
83  itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
84 
86  typedef double TimeStepType;
87 
92 
95 
99 
103 
107 
117  virtual void InitializeIteration() {};
118 
132 #if !defined(CABLE_CONFIGURATION)
133  virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
134  void *globalData,
135  const FloatOffsetType &offset = FloatOffsetType(0.0)) = 0;
136 #endif
137 
140  void SetRadius(const RadiusType &r)
141  { m_Radius = r; }
142 
145  const RadiusType &GetRadius() const
146  { return m_Radius; }
147 
151  void SetScaleCoefficients (PixelRealType vals[ImageDimension])
152  {
153  for( unsigned int i = 0; i < ImageDimension; i++ )
154  {
155  m_ScaleCoefficients[i] = vals[i];
156  }
157  }
158 
162  const NeighborhoodScalesType ComputeNeighborhoodScales() const;
163 
170  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const =0;
171 
179  virtual void *GetGlobalDataPointer() const =0;
180 
186  virtual void ReleaseGlobalDataPointer(void *GlobalData) const =0;
187 
188 protected:
190  {
191  // initialize variables
192  m_Radius.Fill( 0 );
193  for (unsigned int i = 0; i < ImageDimension; i++)
194  {
195  m_ScaleCoefficients[i] = 1.0;
196  }
197  }
199  void PrintSelf(std::ostream& os, Indent indent) const;
200 
202  PixelRealType m_ScaleCoefficients[ImageDimension];
203 
204 private:
205  FiniteDifferenceFunction(const Self&); //purposely not implemented
206  void operator=(const Self&); //purposely not implemented
207 };
208 
209 } // end namespace itk
210 
211 // Define instantiation macro for this template.
212 #define ITK_TEMPLATE_FiniteDifferenceFunction(_, EXPORT, x, y) namespace itk { \
213  _(1(class EXPORT FiniteDifferenceFunction< ITK_TEMPLATE_1 x >)) \
214  namespace Templates { typedef FiniteDifferenceFunction< ITK_TEMPLATE_1 x > FiniteDifferenceFunction##y; } \
215  }
216 
217 #if ITK_TEMPLATE_EXPLICIT
218 # include "Templates/itkFiniteDifferenceFunction+-.h"
219 #endif
220 
221 #if ITK_TEMPLATE_TXX
223 #endif
224 
225 #endif

Generated at Sat Feb 2 2013 23:37:54 for Orfeo Toolbox with doxygen 1.8.1.1