00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGaussianDerivativeImageFunction_h
00018 #define __itkGaussianDerivativeImageFunction_h
00019
00020 #include "itkNeighborhoodOperatorImageFunction.h"
00021 #include "itkImageFunction.h"
00022 #include "itkGaussianDerivativeSpatialFunction.h"
00023 #include "itkGaussianSpatialFunction.h"
00024
00025 namespace itk
00026 {
00027
00037 template <class TInputImage,class TOutput=double>
00038 class ITK_EXPORT GaussianDerivativeImageFunction :
00039 public ImageFunction< TInputImage,
00040 Vector<TOutput,::itk::GetImageDimension<TInputImage>::ImageDimension>,
00041 TOutput >
00042 {
00043 public:
00044
00046 typedef GaussianDerivativeImageFunction Self;
00047
00049 typedef ImageFunction<TInputImage,
00050 Vector<TOutput,::itk::GetImageDimension<TInputImage>::ImageDimension>,
00051 TOutput > Superclass;
00052
00054 typedef SmartPointer<Self> Pointer;
00055 typedef SmartPointer<const Self> ConstPointer;
00056
00058 itkNewMacro(Self);
00059
00061 itkTypeMacro( GaussianDerivativeImageFunction, ImageFunction );
00062
00064 typedef TInputImage InputImageType;
00065 typedef typename InputImageType::PixelType InputPixelType;
00066 typedef typename InputImageType::IndexType IndexType;
00067
00069 itkStaticConstMacro(ImageDimension2, unsigned int,
00070 InputImageType::ImageDimension);
00071
00072 typedef ContinuousIndex<TOutput,itkGetStaticConstMacro(ImageDimension2)>
00073 ContinuousIndexType;
00074
00075
00076 typedef Neighborhood<InputPixelType, itkGetStaticConstMacro(ImageDimension2)> NeighborhoodType;
00077 typedef Neighborhood<TOutput, itkGetStaticConstMacro(ImageDimension2)> OperatorNeighborhoodType;
00078
00079 typedef Vector<TOutput,itkGetStaticConstMacro(ImageDimension2)> VectorType;
00080 typedef typename Superclass::OutputType OutputType;
00081 typedef FixedArray<OperatorNeighborhoodType,2*itkGetStaticConstMacro(ImageDimension2)> OperatorArrayType;
00082 typedef NeighborhoodOperatorImageFunction<InputImageType,
00083 TOutput> OperatorImageFunctionType;
00084 typedef typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer;
00085
00086 typedef GaussianDerivativeSpatialFunction<TOutput,1> GaussianDerivativeFunctionType;
00087 typedef typename GaussianDerivativeFunctionType::Pointer GaussianDerivativeFunctionPointer;
00088
00089 typedef GaussianSpatialFunction<TOutput,1> GaussianFunctionType;
00090 typedef typename GaussianFunctionType::Pointer GaussianFunctionPointer;
00091
00093 typedef Point<TOutput,itkGetStaticConstMacro(ImageDimension2)> PointType;
00094
00096 virtual OutputType Evaluate(const PointType& point) const;
00097
00098
00100 virtual OutputType EvaluateAtIndex( const IndexType & index ) const;
00101
00103 virtual OutputType EvaluateAtContinuousIndex(
00104 const ContinuousIndexType & index ) const;
00105
00111 void SetSigma( const double* sigma);
00112 void SetSigma( const double sigma);
00113 const double* GetSigma() const {return m_Sigma;}
00115
00117 void SetExtent( const double* extent);
00118 void SetExtent( const double extent);
00119 const double* GetExtent() const {return m_Extent;}
00121
00126 virtual void SetInputImage( const InputImageType * ptr );
00127
00128 protected:
00129 GaussianDerivativeImageFunction();
00130 GaussianDerivativeImageFunction( const Self& ){};
00131
00132 ~GaussianDerivativeImageFunction(){};
00133
00134 void operator=( const Self& ){};
00135 void PrintSelf(std::ostream& os, Indent indent) const;
00136
00137 void RecomputeGaussianKernel();
00138 void RecomputeContinuousGaussianKernel(
00139 const double* offset) const;
00140
00141
00142 private:
00143
00144 double m_Sigma[ImageDimension2];
00145
00148 mutable OperatorArrayType m_OperatorArray;
00149 mutable OperatorArrayType m_ContinuousOperatorArray;
00150
00152 OperatorImageFunctionPointer m_OperatorImageFunction;
00153 double m_Extent[ImageDimension2];
00154
00156 bool m_UseImageSpacing;
00157
00159 GaussianDerivativeFunctionPointer m_GaussianDerivativeFunction;
00160 GaussianFunctionPointer m_GaussianFunction;
00161
00162 };
00163
00164 }
00165
00166
00167 #define ITK_TEMPLATE_GaussianDerivativeImageFunction(_, EXPORT, x, y) namespace itk { \
00168 _(2(class EXPORT GaussianDerivativeImageFunction< ITK_TEMPLATE_2 x >)) \
00169 namespace Templates { typedef GaussianDerivativeImageFunction< ITK_TEMPLATE_2 x > \
00170 GaussianDerivativeImageFunction##y; } \
00171 }
00172
00173 #if ITK_TEMPLATE_EXPLICIT
00174 # include "Templates/itkGaussianDerivativeImageFunction+-.h"
00175 #endif
00176
00177 #if ITK_TEMPLATE_TXX
00178 # include "itkGaussianDerivativeImageFunction.txx"
00179 #endif
00180
00181 #endif
00182