00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef _itkGaussianBlurImageFunction_h
00018
#define _itkGaussianBlurImageFunction_h
00019
00020
#include "itkNeighborhoodOperatorImageFunction.h"
00021
#include "itkGaussianOperator.h"
00022
#include "itkGaussianSpatialFunction.h"
00023
#include "itkImageFunction.h"
00024
00025
namespace itk
00026 {
00027
00037
template <
class TInputImage,
class TOutput=
double>
00038 class ITK_EXPORT GaussianBlurImageFunction :
00039
public ImageFunction< TInputImage, TOutput >
00040 {
00041
public:
00042
00044 typedef GaussianBlurImageFunction
Self;
00045
00047 typedef ImageFunction<TInputImage, TOutput> Superclass;
00048
00050 typedef SmartPointer<Self> Pointer;
00051 typedef SmartPointer<const Self> ConstPointer;
00052
00054
itkNewMacro(
Self);
00055
00057
itkTypeMacro( GaussianBlurImageFunction,
ImageFunction );
00058
00060 typedef TInputImage
InputImageType;
00061 typedef typename InputImageType::PixelType
InputPixelType;
00062 typedef typename Superclass::IndexType
IndexType;
00063 typedef typename Superclass::ContinuousIndexType
ContinuousIndexType;
00064
typedef NeighborhoodOperatorImageFunction<
InputImageType,
00065 TOutput>
OperatorImageFunctionType;
00066 typedef typename OperatorImageFunctionType::Pointer
OperatorImageFunctionPointer;
00067
00069
itkStaticConstMacro(ImageDimension,
unsigned int,
00070 InputImageType::ImageDimension);
00071
00072
typedef GaussianOperator<TOutput,
00073
itkGetStaticConstMacro(ImageDimension)>
00074 GaussianOperatorType;
00075 typedef Neighborhood<TOutput, itkGetStaticConstMacro(ImageDimension)> NeighborhoodType;
00076 typedef FixedArray<NeighborhoodType,itkGetStaticConstMacro(ImageDimension)> OperatorArrayType;
00077
00078 typedef GaussianSpatialFunction<TOutput,1> GaussianFunctionType;
00079 typedef typename GaussianFunctionType::Pointer
GaussianFunctionPointer;
00080
00082 typedef typename Superclass::PointType
PointType;
00083
00085
virtual TOutput Evaluate(
const PointType& point)
const;
00086
00087
00089
virtual TOutput EvaluateAtIndex(
const IndexType & index )
const;
00090
00092
virtual TOutput EvaluateAtContinuousIndex(
00093
const ContinuousIndexType & index )
const;
00094
00101
void SetSigma(
const double sigma[ImageDimension] );
00102
void SetSigma(
const float sigma[ImageDimension] );
00103
void SetSigma(
const double sigma);
00104 const double* GetSigma()
const {
return m_Sigma;}
00105
00110
virtual void SetInputImage(
const InputImageType * ptr );
00111
00112
void SetExtent(
const double extent[ImageDimension] );
00113
void SetExtent(
const double extent);
00114
const double* GetExtent()
const {
return m_Extent;}
00115
00116
protected:
00117 GaussianBlurImageFunction();
00118 GaussianBlurImageFunction(
const Self& ){};
00119
00120 ~GaussianBlurImageFunction(){};
00121
00122
void operator=(
const Self& ){};
00123 void PrintSelf(std::ostream& os,
Indent indent)
const;
00124
00125
void RecomputeGaussianKernel();
00126
void RecomputeContinuousGaussianKernel(
00127
const double offset[ImageDimension] )
const;
00128
00129
private:
00130
00131
double m_Sigma[ImageDimension];
00132
OperatorImageFunctionPointer m_OperatorImageFunction;
00133
mutable OperatorArrayType m_OperatorArray;
00134
mutable OperatorArrayType m_ContinuousOperatorArray;
00135
00139
double m_MaximumError[ImageDimension];
00140
double m_Extent[ImageDimension];
00141
00144
int m_MaximumKernelWidth;
00145
00147
unsigned int m_FilterDimensionality;
00148
00150
bool m_UseImageSpacing;
00151
00153
GaussianFunctionPointer m_GaussianFunction;
00154 };
00155
00156 }
00157
00158
#ifndef ITK_MANUAL_INSTANTIATION
00159
#include "itkGaussianBlurImageFunction.txx"
00160
#endif
00161
00162
#endif
00163