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;}
00114
00116 void SetExtent( const double* extent);
00117 void SetExtent( const double extent);
00118 const double* GetExtent() const {return m_Extent;}
00119
00124 virtual void SetInputImage( const InputImageType * ptr );
00125
00126 protected:
00127 GaussianDerivativeImageFunction();
00128 GaussianDerivativeImageFunction( const Self& ){};
00129
00130 ~GaussianDerivativeImageFunction(){};
00131
00132 void operator=( const Self& ){};
00133 void PrintSelf(std::ostream& os, Indent indent) const;
00134
00135 void RecomputeGaussianKernel();
00136 void RecomputeContinuousGaussianKernel(
00137 const double* offset) const;
00138
00139
00140 private:
00141
00142 double m_Sigma[ImageDimension2];
00143
00146 mutable OperatorArrayType m_OperatorArray;
00147 mutable OperatorArrayType m_ContinuousOperatorArray;
00148
00150 OperatorImageFunctionPointer m_OperatorImageFunction;
00151 double m_Extent[ImageDimension2];
00152
00154 bool m_UseImageSpacing;
00155
00157 GaussianDerivativeFunctionPointer m_GaussianDerivativeFunction;
00158 GaussianFunctionPointer m_GaussianFunction;
00159
00160 };
00161
00162 }
00163
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkGaussianDerivativeImageFunction.txx"
00166 #endif
00167
00168 #endif
00169