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: 2009-04-25 12:24:02 $
00007   Version:   $Revision: 1.36 $
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 
00127   itkSetMacro( UseImageDirection, bool );
00128   itkGetConstMacro( UseImageDirection, bool );
00129   itkBooleanMacro( UseImageDirection );
00131 
00132 protected:
00133   CentralDifferenceImageFunction();
00134   ~CentralDifferenceImageFunction(){};
00135   void PrintSelf(std::ostream& os, Indent indent) const;
00136 
00137 private:
00138   CentralDifferenceImageFunction( const Self& ); //purposely not implemented
00139   void operator=( const Self& ); //purposely not implemented
00140 
00141   // flag to take or not the image direction into account
00142   // when computing the derivatives.
00143   bool m_UseImageDirection;
00144 
00145 };
00146 
00147 } // end namespace itk
00148 
00149 // Define instantiation macro for this template.
00150 #define ITK_TEMPLATE_CentralDifferenceImageFunction(_, EXPORT, x, y) namespace itk { \
00151   _(2(class EXPORT CentralDifferenceImageFunction< ITK_TEMPLATE_2 x >)) \
00152   namespace Templates { typedef CentralDifferenceImageFunction< ITK_TEMPLATE_2 x > \
00153                                             CentralDifferenceImageFunction##y; } \
00154   }
00155 
00156 #if ITK_TEMPLATE_EXPLICIT
00157 # include "Templates/itkCentralDifferenceImageFunction+-.h"
00158 #endif
00159 
00160 #if ITK_TEMPLATE_TXX
00161 # include "itkCentralDifferenceImageFunction.txx"
00162 #endif
00163 
00164 #endif
00165 

Generated at Mon Jul 12 2010 18:02:06 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000