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: 2007/12/29 17:51:23 $
00007   Version:   $Revision: 1.39 $
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   itkGetMacro( NormalizeAcrossScale, bool );
00131 
00137   virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00138 
00147   itkSetMacro( UseImageDirection, bool );
00148   itkGetMacro( UseImageDirection, bool );
00149   itkBooleanMacro( UseImageDirection );
00151 
00152 #ifdef ITK_USE_CONCEPT_CHECKING
00153 
00154   itkConceptMacro(InputHasNumericTraitsCheck,
00155                   (Concept::HasNumericTraits<PixelType>));
00156   itkConceptMacro(OutputHasPixelTraitsCheck,
00157                   (Concept::HasPixelTraits<OutputPixelType>));
00158 
00160 #endif
00161 
00162 protected:
00163   GradientRecursiveGaussianImageFilter();
00164   virtual ~GradientRecursiveGaussianImageFilter() {};
00165   void PrintSelf(std::ostream& os, Indent indent) const;
00166   
00168   void GenerateData( void );
00169 
00170   // Override since the filter produces the entire dataset
00171   void EnlargeOutputRequestedRegion(DataObject *output);
00172 
00173 private:
00174   GradientRecursiveGaussianImageFilter(const Self&); //purposely not implemented
00175   void operator=(const Self&); //purposely not implemented
00176   
00177   std::vector<GaussianFilterPointer>   m_SmoothingFilters;
00178   DerivativeFilterPointer              m_DerivativeFilter;
00179   OutputImageAdaptorPointer            m_ImageAdaptor;
00180 
00182   bool m_NormalizeAcrossScale; 
00183 
00185   bool m_UseImageDirection;
00186 };
00187 
00188 } // end namespace itk
00189 
00190 #ifndef ITK_MANUAL_INSTANTIATION
00191 #include "itkGradientRecursiveGaussianImageFilter.txx"
00192 #endif
00193 
00194 #endif
00195 

Generated at Wed Nov 5 21:39:09 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000