00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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& );
00139 void operator=( const Self& );
00140
00141
00142
00143 bool m_UseImageDirection;
00144
00145 };
00146
00147 }
00148
00149
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