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

itkGradientRecursiveGaussianImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGradientRecursiveGaussianImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-25 12:27:24 $
00007   Version:   $Revision: 1.42 $
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 #ifndef __itkGradientRecursiveGaussianImageFilter_h
00018 #define __itkGradientRecursiveGaussianImageFilter_h
00019 
00020 #include "itkRecursiveGaussianImageFilter.h"
00021 #include "itkNthElementImageAdaptor.h"
00022 #include "itkImage.h"
00023 #include "itkCovariantVector.h"
00024 #include "itkPixelTraits.h"
00025 #include "itkProgressAccumulator.h"
00026 #include <vector>
00027 
00028 
00029 namespace itk
00030 {
00031 
00043 // NOTE that the ITK_TYPENAME macro has to be used here in lieu 
00044 // of "typename" because VC++ doesn't like the typename keyword 
00045 // on the defaults of template parameters
00046 template <typename TInputImage, 
00047           typename TOutputImage= Image< CovariantVector< 
00048   ITK_TYPENAME NumericTraits< ITK_TYPENAME TInputImage::PixelType>::RealType,
00049   ::itk::GetImageDimension<TInputImage>::ImageDimension >,
00050                                         ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00051 class ITK_EXPORT GradientRecursiveGaussianImageFilter:
00052     public ImageToImageFilter<TInputImage,TOutputImage>
00053 {
00054 public:
00056   typedef GradientRecursiveGaussianImageFilter         Self;
00057   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00058   typedef SmartPointer<Self>                           Pointer;
00059   typedef SmartPointer<const Self>                     ConstPointer;
00060 
00061   
00063   typedef TInputImage                                    InputImageType;
00064   typedef typename TInputImage::PixelType                PixelType;
00065   typedef typename NumericTraits<PixelType>::RealType    RealType;
00066 
00067 
00069   itkStaticConstMacro(ImageDimension, unsigned int,
00070                       TInputImage::ImageDimension);
00071 
00076   typedef float                                            InternalRealType;
00077   typedef Image<InternalRealType, 
00078                 itkGetStaticConstMacro(ImageDimension) >   RealImageType;
00079 
00080 
00085   typedef NthElementImageAdaptor< TOutputImage,
00086                                   InternalRealType >  OutputImageAdaptorType;
00087   typedef typename OutputImageAdaptorType::Pointer    OutputImageAdaptorPointer;
00088 
00090   typedef RecursiveGaussianImageFilter<
00091     RealImageType,
00092     RealImageType
00093     >    GaussianFilterType;
00094 
00096   typedef RecursiveGaussianImageFilter<
00097     InputImageType,
00098     RealImageType
00099     >    DerivativeFilterType;
00100 
00101 
00103   typedef typename GaussianFilterType::Pointer    GaussianFilterPointer;
00104 
00106   typedef typename DerivativeFilterType::Pointer  DerivativeFilterPointer;
00107 
00109   typedef typename TOutputImage::Pointer          OutputImagePointer;
00110 
00111 
00113   typedef TOutputImage                                      OutputImageType;
00114   typedef typename          OutputImageType::PixelType      OutputPixelType;
00115   typedef typename PixelTraits<OutputPixelType>::ValueType  OutputComponentType;
00116 
00118   itkNewMacro(Self);
00119 
00121   itkTypeMacro(GradientRecursiveGaussianImageFilter, 
00122                ImageToImageFilter);
00123 
00125   void SetSigma( RealType sigma );
00126 
00128   void SetNormalizeAcrossScale( bool normalizeInScaleSpace );
00129   itkGetConstMacro( NormalizeAcrossScale, bool );
00131 
00137   virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00138 
00151   itkSetMacro( UseImageDirection, bool );
00152   itkGetConstMacro( UseImageDirection, bool );
00153   itkBooleanMacro( UseImageDirection );
00155 
00156 #ifdef ITK_USE_CONCEPT_CHECKING
00157 
00158   itkConceptMacro(InputHasNumericTraitsCheck,
00159                   (Concept::HasNumericTraits<PixelType>));
00160   itkConceptMacro(OutputHasPixelTraitsCheck,
00161                   (Concept::HasPixelTraits<OutputPixelType>));
00162 
00164 #endif
00165 
00166 protected:
00167   GradientRecursiveGaussianImageFilter();
00168   virtual ~GradientRecursiveGaussianImageFilter() {};
00169   void PrintSelf(std::ostream& os, Indent indent) const;
00170   
00172   void GenerateData( void );
00173 
00174   // Override since the filter produces the entire dataset
00175   void EnlargeOutputRequestedRegion(DataObject *output);
00176 
00177 private:
00178   GradientRecursiveGaussianImageFilter(const Self&); //purposely not implemented
00179   void operator=(const Self&); //purposely not implemented
00180   
00181   std::vector<GaussianFilterPointer>   m_SmoothingFilters;
00182   DerivativeFilterPointer              m_DerivativeFilter;
00183   OutputImageAdaptorPointer            m_ImageAdaptor;
00184 
00186   bool m_NormalizeAcrossScale; 
00187 
00189   bool m_UseImageDirection;
00190 };
00191 
00192 } // end namespace itk
00193 
00194 #ifndef ITK_MANUAL_INSTANTIATION
00195 #include "itkGradientRecursiveGaussianImageFilter.txx"
00196 #endif
00197 
00198 #endif
00199 

Generated at Thu May 28 10:04:19 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000