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

itkDiscreteGaussianDerivativeImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDiscreteGaussianDerivativeImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:43:41 $
00007   Version:   $Revision: 1.6 $
00008 
00009   Copyright (c) Insight Software 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 
00018 #ifndef __itkDiscreteGaussianDerivativeImageFilter_h
00019 #define __itkDiscreteGaussianDerivativeImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkFixedArray.h"
00023 #include "itkImage.h"
00024 
00025 namespace itk
00026 {
00059 template <class TInputImage, class TOutputImage >
00060 class ITK_EXPORT DiscreteGaussianDerivativeImageFilter :
00061     public ImageToImageFilter< TInputImage, TOutputImage >
00062 {
00063 public:
00065   typedef DiscreteGaussianDerivativeImageFilter           Self;
00066   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00067   typedef SmartPointer<Self>                              Pointer;
00068   typedef SmartPointer<const Self>                        ConstPointer;
00069 
00071   itkNewMacro(Self);
00072 
00074   itkTypeMacro(DiscreteGaussianDerivativeImageFilter, ImageToImageFilter);
00075 
00077   typedef TInputImage  InputImageType;
00078   typedef TOutputImage OutputImageType;
00079 
00082   typedef typename TOutputImage::PixelType         OutputPixelType;
00083   typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
00084   typedef typename TInputImage::PixelType          InputPixelType;
00085   typedef typename TInputImage::InternalPixelType  InputInternalPixelType;
00086 
00089   itkStaticConstMacro(ImageDimension, unsigned int,
00090                       TOutputImage::ImageDimension);
00091 
00093   typedef FixedArray<double, itkGetStaticConstMacro(ImageDimension)> ArrayType;
00094 
00096   typedef FixedArray<unsigned int, itkGetStaticConstMacro(ImageDimension)> OrderArrayType;
00097 
00101   itkSetMacro(Order, OrderArrayType);
00102   itkGetConstMacro(Order, const OrderArrayType);
00104 
00111   itkSetMacro(Variance, ArrayType);
00112   itkGetConstMacro(Variance, const ArrayType);
00114 
00118   itkSetMacro(MaximumError, ArrayType);
00119   itkGetConstMacro(MaximumError, const ArrayType);
00121 
00124   itkGetConstMacro(MaximumKernelWidth, int);
00125   itkSetMacro(MaximumKernelWidth, int);
00127 
00130   void SetOrder (const typename OrderArrayType::ValueType v)
00131     {
00132     m_Order.Fill(v);
00133     }
00134 
00135   void SetVariance (const typename ArrayType::ValueType v)
00136     {
00137     m_Variance.Fill(v);
00138     }
00139 
00140   void SetMaximumError (const typename ArrayType::ValueType v)
00141     {
00142     m_MaximumError.Fill(v);
00143     }
00144 
00145   void SetOrder (const unsigned int *v)
00146     {
00147     OrderArrayType dv;
00148     for (unsigned int i = 0; i < ImageDimension; i++)
00149       {
00150       dv[i] = v[i];
00151       }
00152     this->SetOrder(dv);
00153     }
00154 
00155   void SetVariance (const double *v)
00156     {
00157     ArrayType dv;
00158     for (unsigned int i = 0; i < ImageDimension; i++)
00159       {
00160       dv[i] = v[i];
00161       }
00162     this->SetVariance(dv);
00163     }
00164 
00165   void SetVariance (const float *v)
00166     {
00167     ArrayType dv;
00168     for (unsigned int i = 0; i < ImageDimension; i++)
00169       {
00170       dv[i] = v[i];
00171       }
00172     this->SetVariance(dv);
00173     }
00174 
00175   void SetMaximumError (const double *v)
00176     {
00177     ArrayType dv;
00178     for (unsigned int i = 0; i < ImageDimension; i++)
00179       {
00180       dv[i] = v[i];
00181       }
00182     this->SetMaximumError(dv);
00183     }
00184 
00185   void SetMaximumError (const float *v)
00186     {
00187     ArrayType dv;
00188     for (unsigned int i = 0; i < ImageDimension; i++)
00189       {
00190       dv[i] = v[i];
00191       }
00192     this->SetMaximumError(dv);
00193     }
00194 
00198   void SetUseImageSpacingOn() { this->SetUseImageSpacing(true); }
00199 
00202   void SetUseImageSpacingOff() { this->SetUseImageSpacing(false); }
00203 
00206   itkSetMacro(UseImageSpacing, bool);
00207   itkGetConstMacro(UseImageSpacing, bool);
00209 
00216   virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00217 
00218 #ifdef ITK_USE_CONCEPT_CHECKING
00219 
00220   itkConceptMacro(OutputHasNumericTraitsCheck,
00221     (Concept::HasNumericTraits<OutputPixelType>));
00222 
00224 #endif
00225 
00226 protected:
00227 
00228   DiscreteGaussianDerivativeImageFilter()
00229     {
00230     m_Order.Fill(1);
00231     m_Variance.Fill(0.0);
00232     m_MaximumError.Fill(0.01);
00233     m_MaximumKernelWidth = 32;
00234     m_UseImageSpacing = true;
00235     }
00236   virtual ~DiscreteGaussianDerivativeImageFilter() {}
00237   void PrintSelf(std::ostream& os, Indent indent) const;
00238 
00244   void GenerateData();
00245 
00246 private:
00247 
00248   DiscreteGaussianDerivativeImageFilter(const Self&); //purposely not implemented
00249   void operator=(const Self&); //purposely not implemented
00250 
00252   OrderArrayType m_Order;
00253 
00255   ArrayType m_Variance;
00256 
00260   ArrayType m_MaximumError;
00261 
00264   int m_MaximumKernelWidth;
00265 
00267   bool m_UseImageSpacing;
00268 };
00269 
00270 } // end namespace itk
00271 
00272 #ifndef ITK_MANUAL_INSTANTIATION
00273 #include "itkDiscreteGaussianDerivativeImageFilter.txx"
00274 #endif
00275 
00276 #endif
00277 

Generated at Tue Sep 15 02:48:40 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000