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

itkHessianRecursiveGaussianImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkHessianRecursiveGaussianImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/10/27 19:51:42 $
00007   Version:   $Revision: 1.8 $
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 __itkHessianRecursiveGaussianImageFilter_h
00018 #define __itkHessianRecursiveGaussianImageFilter_h
00019 
00020 #include "itkRecursiveGaussianImageFilter.h"
00021 #include "itkNthElementImageAdaptor.h"
00022 #include "itkImage.h"
00023 #include "itkSymmetricSecondRankTensor.h"
00024 #include "itkPixelTraits.h"
00025 #include "itkCommand.h"
00026 
00027 
00028 namespace itk
00029 {
00030 
00042 // NOTE that the ITK_TYPENAME macro has to be used here in lieu 
00043 // of "typename" because VC++ doesn't like the typename keyword 
00044 // on the defaults of template parameters
00045 template <typename TInputImage, 
00046           typename TOutputImage= Image< SymmetricSecondRankTensor< 
00047   ITK_TYPENAME NumericTraits< ITK_TYPENAME TInputImage::PixelType>::RealType,
00048   ::itk::GetImageDimension<TInputImage>::ImageDimension >,
00049                                         ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00050 class ITK_EXPORT HessianRecursiveGaussianImageFilter:
00051     public ImageToImageFilter<TInputImage,TOutputImage>
00052 {
00053 public:
00055   typedef HessianRecursiveGaussianImageFilter  Self;
00056   typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00057   typedef SmartPointer<Self>                   Pointer;
00058   typedef SmartPointer<const Self>        ConstPointer;
00059 
00060   
00062   typedef TInputImage                                    InputImageType;
00063   typedef typename TInputImage::PixelType                PixelType;
00064   typedef typename NumericTraits<PixelType>::RealType    RealType;
00065 
00066 
00068   itkStaticConstMacro(ImageDimension, unsigned int,
00069                       ::itk::GetImageDimension<TInputImage>::ImageDimension);
00070 
00072   itkStaticConstMacro(NumberOfSmoothingFilters, unsigned int,
00073                       ::itk::GetImageDimension<TInputImage>::ImageDimension-2);
00074 
00079   typedef float                                            InternalRealType;
00080   typedef Image<InternalRealType, 
00081                 ::itk::GetImageDimension<TInputImage>::ImageDimension >   RealImageType;
00082 
00083 
00084 
00085 
00090   typedef NthElementImageAdaptor< TOutputImage,
00091                                   InternalRealType >  OutputImageAdaptorType;
00092   typedef typename OutputImageAdaptorType::Pointer OutputImageAdaptorPointer;
00093 
00095   typedef RecursiveGaussianImageFilter<
00096                                 RealImageType,
00097                                 RealImageType
00098                                         >    GaussianFilterType;
00099 
00101   typedef RecursiveGaussianImageFilter<
00102                                 InputImageType,
00103                                 RealImageType
00104                                         >    DerivativeFilterAType;
00105 
00106   typedef RecursiveGaussianImageFilter<
00107                                 RealImageType,
00108                                 RealImageType
00109                                         >    DerivativeFilterBType;
00110 
00112   typedef typename GaussianFilterType::Pointer    GaussianFilterPointer;
00113   typedef std::vector< GaussianFilterPointer >    GaussianFiltersArray;
00114 
00116   typedef typename DerivativeFilterAType::Pointer  DerivativeFilterAPointer;
00117   typedef typename DerivativeFilterBType::Pointer  DerivativeFilterBPointer;
00118 
00120   typedef typename TOutputImage::Pointer          OutputImagePointer;                                  
00121 
00122 
00124   typedef TOutputImage      OutputImageType;
00125   typedef typename          OutputImageType::PixelType      OutputPixelType;
00126   typedef typename PixelTraits<OutputPixelType>::ValueType  OutputComponentType;
00127 
00129   itkTypeMacro( HessianRecursiveGaussianImageFilter, ImageToImageFilter );
00130 
00132   itkNewMacro(Self);
00133 
00135   void SetSigma( RealType sigma );
00136 
00138   void SetNormalizeAcrossScale( bool normalizeInScaleSpace );
00139   itkGetMacro( NormalizeAcrossScale, bool );
00141 
00147   virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00148 
00149 #ifdef ITK_USE_CONCEPT_CHECKING
00150 
00151   itkConceptMacro(InputHasNumericTraitsCheck,
00152                   (Concept::HasNumericTraits<PixelType>));
00153   itkConceptMacro(OutputHasPixelTraitsCheck,
00154                   (Concept::HasPixelTraits<OutputPixelType>));
00155 
00157 #endif
00158 
00159 protected:
00160   
00161   HessianRecursiveGaussianImageFilter();
00162   virtual ~HessianRecursiveGaussianImageFilter() {};
00163   void PrintSelf(std::ostream& os, Indent indent) const;
00164   
00166   void GenerateData( void );
00167 
00168   // Override since the filter produces the entire dataset
00169   void EnlargeOutputRequestedRegion(DataObject *output);
00170 
00171   
00172 private:
00173 
00174   HessianRecursiveGaussianImageFilter(const Self&); //purposely not implemented
00175   void operator=(const Self&); //purposely not implemented
00176   
00177   GaussianFiltersArray          m_SmoothingFilters;
00178   DerivativeFilterAPointer      m_DerivativeFilterA;
00179   DerivativeFilterBPointer      m_DerivativeFilterB;
00180   OutputImageAdaptorPointer     m_ImageAdaptor;
00181 
00183   bool m_NormalizeAcrossScale; 
00184 
00185 };
00186 
00187 } // end namespace itk
00188 
00189 #ifndef ITK_MANUAL_INSTANTIATION
00190 #include "itkHessianRecursiveGaussianImageFilter.txx"
00191 #endif
00192 
00193 #endif
00194 
00195 
00196 
00197 
00198 

Generated at Tue Jul 29 20:22:25 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000