00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkDiscreteGaussianImageFilter_h
00018 #define __itkDiscreteGaussianImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022
00023 namespace itk
00024 {
00045 template <class TInputImage, class TOutputImage >
00046 class ITK_EXPORT DiscreteGaussianImageFilter :
00047 public ImageToImageFilter< TInputImage, TOutputImage >
00048 {
00049 public:
00051 typedef DiscreteGaussianImageFilter Self;
00052 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00053 typedef SmartPointer<Self> Pointer;
00054 typedef SmartPointer<const Self> ConstPointer;
00055
00057 itkNewMacro(Self);
00058
00060 itkTypeMacro(DiscreteGaussianImageFilter, ImageToImageFilter);
00061
00063 typedef TInputImage InputImageType;
00064 typedef TOutputImage OutputImageType;
00065
00068 typedef typename TOutputImage::PixelType OutputPixelType;
00069 typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00070 typedef typename TInputImage::PixelType InputPixelType;
00071 typedef typename TInputImage::InternalPixelType InputInternalPixelType;
00072
00075 itkStaticConstMacro(ImageDimension, unsigned int,
00076 TOutputImage::ImageDimension);
00077
00079 itkSetVectorMacro(Variance, double, ImageDimension);
00080 itkSetVectorMacro(Variance, float, ImageDimension);
00081 itkGetVectorMacro(Variance, const double, ImageDimension);
00082 itkSetVectorMacro(MaximumError, double, ImageDimension);
00083 itkSetVectorMacro(MaximumError, float, ImageDimension);
00084 itkGetVectorMacro(MaximumError, const double, ImageDimension);
00085 itkGetMacro(MaximumKernelWidth, int);
00086 itkSetMacro(MaximumKernelWidth, int);
00087 itkGetMacro(FilterDimensionality, unsigned int);
00088 itkSetMacro(FilterDimensionality, unsigned int);
00089
00092 void SetVariance(const double v)
00093 {
00094 double vArray[ImageDimension];
00095 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = v; }
00096 this->SetVariance(vArray);
00097 }
00098 void SetMaximumError(const double v)
00099 {
00100 double vArray[ImageDimension];
00101 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = v; }
00102 this->SetMaximumError(vArray);
00103 }
00104
00107 void SetVariance(const float v)
00108 {
00109 double vArray[ImageDimension];
00110 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = static_cast<double>(v); }
00111 this->SetVariance(vArray);
00112 }
00113 void SetMaximumError(const float v)
00114 {
00115 double vArray[ImageDimension];
00116 for (unsigned int i = 0; i<ImageDimension; ++i) { vArray[i] = static_cast<double>(v); }
00117 this->SetMaximumError(vArray);
00118 }
00119
00126 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00127
00128 protected:
00129 DiscreteGaussianImageFilter()
00130 {
00131 unsigned int i;
00132 for (i = 0; i < ImageDimension; i++)
00133 {
00134 m_Variance[i] = 0.0f;
00135 m_MaximumError[i] = 0.01f;
00136 m_MaximumKernelWidth = 32;
00137 }
00138 m_FilterDimensionality = ImageDimension;
00139 }
00140 virtual ~DiscreteGaussianImageFilter() {}
00141 void PrintSelf(std::ostream& os, Indent indent) const;
00142
00148 void GenerateData();
00149
00150
00151 private:
00152 DiscreteGaussianImageFilter(const Self&);
00153 void operator=(const Self&);
00154
00156 double m_Variance[ImageDimension];
00157
00161 double m_MaximumError[ImageDimension];
00162
00165 int m_MaximumKernelWidth;
00166
00168 unsigned int m_FilterDimensionality;
00169 };
00170
00171 }
00172
00173 #ifndef ITK_MANUAL_INSTANTIATION
00174 #include "itkDiscreteGaussianImageFilter.txx"
00175 #endif
00176
00177 #endif