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

itkCentralDifferenceImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCentralDifferenceImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/10/08 11:14:54 $
00007   Version:   $Revision: 1.33 $
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 __itkCentralDifferenceImageFunction_h
00018 #define __itkCentralDifferenceImageFunction_h
00019 
00020 #include "itkImageFunction.h"
00021 #include "itkCovariantVector.h"
00022 #include "itkImageBase.h"
00023 
00024 namespace itk
00025 {
00026 
00039 template <
00040   class TInputImage, 
00041   class TCoordRep = float >
00042 class ITK_EXPORT CentralDifferenceImageFunction :
00043   public ImageFunction< TInputImage, 
00044                         CovariantVector<double, \
00045                         ::itk::GetImageDimension<TInputImage>::ImageDimension>, 
00046                         TCoordRep >
00047 {
00048 public:
00049 
00051   itkStaticConstMacro(ImageDimension, unsigned int,
00052                       TInputImage::ImageDimension);
00053 
00055   typedef CentralDifferenceImageFunction Self;
00056   typedef ImageFunction<TInputImage,
00057                         CovariantVector<double, 
00058                         itkGetStaticConstMacro(ImageDimension)>,
00059                         TCoordRep>       Superclass;
00060   typedef SmartPointer<Self>             Pointer;
00061   typedef SmartPointer<const Self>       ConstPointer;
00062 
00064   itkTypeMacro(CentralDifferenceImageFunction, ImageFunction);
00065 
00067   itkNewMacro(Self);
00068 
00070   typedef TInputImage InputImageType;
00071 
00073   typedef typename Superclass::OutputType OutputType;
00074 
00076   typedef typename Superclass::IndexType IndexType;
00077 
00079   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00080 
00082   typedef typename Superclass::PointType PointType;
00083 
00091   virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
00092 
00101    virtual OutputType Evaluate( const PointType& point ) const
00102     { 
00103     IndexType index;
00104     this->ConvertPointToNearestIndex( point, index );
00105     return this->EvaluateAtIndex( index ); 
00106     }
00107   virtual OutputType EvaluateAtContinuousIndex( 
00108     const ContinuousIndexType& cindex ) const
00109     { 
00110     IndexType index;
00111     this->ConvertContinuousIndexToNearestIndex( cindex, index );
00112     return this->EvaluateAtIndex( index ); 
00113     }
00115 
00124   itkSetMacro( UseImageDirection, bool );
00125   itkGetMacro( UseImageDirection, bool );
00126   itkBooleanMacro( UseImageDirection );
00128 
00129 protected:
00130   CentralDifferenceImageFunction();
00131   ~CentralDifferenceImageFunction(){};
00132   void PrintSelf(std::ostream& os, Indent indent) const;
00133 
00134 private:
00135   CentralDifferenceImageFunction( const Self& ); //purposely not implemented
00136   void operator=( const Self& ); //purposely not implemented
00137 
00138   // flag to take or not the image direction into account
00139   // when computing the derivatives.
00140   bool m_UseImageDirection;
00141 
00142 };
00143 
00144 } // end namespace itk
00145 
00146 // Define instantiation macro for this template.
00147 #define ITK_TEMPLATE_CentralDifferenceImageFunction(_, EXPORT, x, y) namespace itk { \
00148   _(2(class EXPORT CentralDifferenceImageFunction< ITK_TEMPLATE_2 x >)) \
00149   namespace Templates { typedef CentralDifferenceImageFunction< ITK_TEMPLATE_2 x > \
00150                                             CentralDifferenceImageFunction##y; } \
00151   }
00152 
00153 #if ITK_TEMPLATE_EXPLICIT
00154 # include "Templates/itkCentralDifferenceImageFunction+-.h"
00155 #endif
00156 
00157 #if ITK_TEMPLATE_TXX
00158 # include "itkCentralDifferenceImageFunction.txx"
00159 #endif
00160 
00161 #endif
00162 

Generated at Wed Nov 5 20:48:11 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000