Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkDiscreteGaussianImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDiscreteGaussianImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/13 03:14:23 $
00007   Version:   $Revision: 1.25 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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&); //purposely not implemented
00153   void operator=(const Self&); //purposely not implemented
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 } // end namespace itk
00172 
00173 #ifndef ITK_MANUAL_INSTANTIATION
00174 #include "itkDiscreteGaussianImageFilter.txx"
00175 #endif
00176 
00177 #endif

Generated at Wed Mar 12 01:12:53 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000