Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkFiniteDifferenceFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFiniteDifferenceFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/01/30 20:56:07 $
00007   Version:   $Revision: 1.17 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkFiniteDifferenceFunction_h_
00018 #define __itkFiniteDifferenceFunction_h_
00019 
00020 #include "itkLightObject.h"
00021 #include "itkConstNeighborhoodIterator.h"
00022 #include "itkZeroFluxNeumannBoundaryCondition.h"
00023 #include "itkVector.h"
00024 #include "itkFixedArray.h"
00025 
00026 namespace itk {
00027 
00064 template<class TImageType>
00065 class ITK_EXPORT FiniteDifferenceFunction : public LightObject
00066 {
00067 public:
00068 
00070   typedef FiniteDifferenceFunction Self;
00071   typedef LightObject Superclass;
00072 
00073   typedef SmartPointer<Self> Pointer;
00074   typedef SmartPointer<const Self> ConstPointer;
00075 
00077   itkTypeMacro( FiniteDifferenceFunction, LightObject );
00078 
00080   typedef TImageType ImageType;
00081   typedef typename ImageType::PixelType       PixelType;
00082   typedef double PixelRealType;
00083 
00085   itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
00086 
00088   typedef double  TimeStepType;
00089 
00092   typedef ZeroFluxNeumannBoundaryCondition<ImageType>
00093     DefaultBoundaryConditionType;
00094 
00096   typedef typename ConstNeighborhoodIterator<TImageType>::RadiusType RadiusType;
00097 
00100   typedef ConstNeighborhoodIterator<TImageType, DefaultBoundaryConditionType> NeighborhoodType;
00101 
00104   typedef Vector<float,itkGetStaticConstMacro(ImageDimension)> FloatOffsetType;
00105 
00115   virtual void InitializeIteration() {};
00116 
00130 #if !defined(CABLE_CONFIGURATION)
00131   virtual PixelType  ComputeUpdate(const NeighborhoodType &neighborhood,
00132                                    void *globalData,
00133                                    const FloatOffsetType &offset = FloatOffsetType(0.0)) = 0;
00134 #endif
00135 
00138   void SetRadius(const RadiusType &r)
00139     { m_Radius = r; }
00140 
00143   const RadiusType &GetRadius() const
00144     { return m_Radius; }
00145 
00149   void SetScaleCoefficients (PixelRealType vals[ImageDimension])
00150     {
00151       for (unsigned int i = 0; i < ImageDimension; i++)
00152         {
00153         m_ScaleCoefficients[i] = vals[i];
00154         }
00155     }
00157 
00164   virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const =0;
00165 
00173   virtual void *GetGlobalDataPointer() const =0;
00174 
00180   virtual void ReleaseGlobalDataPointer(void *GlobalData) const =0;
00181 
00182 protected:
00183   FiniteDifferenceFunction() 
00184   {
00185     // initialize variables
00186     m_Radius.Fill( 0 );
00187     for (unsigned int i = 0; i < ImageDimension; i++)
00188       {
00189       m_ScaleCoefficients[i] = 1.0;
00190       }
00191   }
00192   ~FiniteDifferenceFunction() {}
00193   void PrintSelf(std::ostream& os, Indent indent) const;
00194 
00195   RadiusType m_Radius;
00196   PixelRealType m_ScaleCoefficients[ImageDimension];
00197 
00198 private:
00199   FiniteDifferenceFunction(const Self&); //purposely not implemented
00200   void operator=(const Self&); //purposely not implemented
00201 };
00202   
00203 } // end namespace itk
00204 
00205 // Define instantiation macro for this template.
00206 #define ITK_TEMPLATE_FiniteDifferenceFunction(_, EXPORT, x, y) namespace itk { \
00207   _(1(class EXPORT FiniteDifferenceFunction< ITK_TEMPLATE_1 x >)) \
00208   namespace Templates { typedef FiniteDifferenceFunction< ITK_TEMPLATE_1 x > FiniteDifferenceFunction##y; } \
00209   }
00210 
00211 #if ITK_TEMPLATE_EXPLICIT
00212 # include "Templates/itkFiniteDifferenceFunction+-.h"
00213 #endif
00214 
00215 #if ITK_TEMPLATE_TXX
00216 # include "itkFiniteDifferenceFunction.txx"
00217 #endif
00218 
00219 #endif
00220 

Generated at Sun Sep 23 12:33:07 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000