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

itkGradientToMagnitudeImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGradientToMagnitudeImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/09/27 11:36:40 $
00007   Version:   $Revision: 1.21 $
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 __itkGradientToMagnitudeImageFilter_h
00018 #define __itkGradientToMagnitudeImageFilter_h
00019 
00020 #include "itkUnaryFunctorImageFilter.h"
00021 
00022 namespace itk
00023 {
00024   
00039 namespace Functor {  
00040   
00041 template< class TInput, class TOutput>
00042 class GradientMagnitude
00043 {
00044 public:
00045   GradientMagnitude() {}
00046   ~GradientMagnitude() {}
00047 
00048   bool operator!=( const GradientMagnitude & ) const
00049   {
00050     return false;
00051   }
00052   bool operator==( const GradientMagnitude & other ) const
00053   {
00054     return !(*this != other);
00055   }
00056   inline TOutput operator()( const TInput & A )
00057   {
00058     return static_cast<TOutput>( A.GetNorm() );
00059   }
00060 }; 
00061 }
00062  
00063 template <class TInputImage, class TOutputImage>
00064 class ITK_EXPORT GradientToMagnitudeImageFilter :
00065     public
00066 UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00067                         Functor::GradientMagnitude< typename TInputImage::PixelType, 
00068                                                     typename TOutputImage::PixelType>   >
00069 {
00070 public:
00072   typedef GradientToMagnitudeImageFilter Self;
00073   typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00074                                   Functor::GradientMagnitude< typename TInputImage::PixelType, 
00075                                                               typename TOutputImage::PixelType> > Superclass;
00076   typedef SmartPointer<Self> Pointer;
00077   typedef SmartPointer<const Self> ConstPointer;
00078 
00080   itkNewMacro(Self);
00081 
00083   itkTypeMacro(GradientToMagnitudeImageFilter, 
00084                UnaryFunctorImageFilter);
00085 
00086 #ifdef ITK_USE_CONCEPT_CHECKING
00087 
00088   itkConceptMacro(InputHasNumericTraitsCheck,
00089     (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
00090 
00092 #endif
00093 
00094 protected:
00095   GradientToMagnitudeImageFilter() {}
00096   virtual ~GradientToMagnitudeImageFilter() {}
00097     
00098 private:
00099   GradientToMagnitudeImageFilter(const Self&); //purposely not implemented
00100   void operator=(const Self&); //purposely not implemented
00101 };
00102  
00103 } // end namespace itk
00104 
00105 
00106 #endif
00107 

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