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: 2008-10-16 16:45:08 $
00007   Version:   $Revision: 1.22 $
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<
00074     TInputImage,TOutputImage, 
00075     Functor::GradientMagnitude< typename TInputImage::PixelType,
00076                                 typename TOutputImage::PixelType> >
00077                                          Superclass;
00078   typedef SmartPointer<Self>             Pointer;
00079   typedef SmartPointer<const Self>       ConstPointer;
00080 
00082   itkNewMacro(Self);
00083 
00085   itkTypeMacro(GradientToMagnitudeImageFilter, 
00086                UnaryFunctorImageFilter);
00087 
00088 #ifdef ITK_USE_CONCEPT_CHECKING
00089 
00090   itkConceptMacro(InputHasNumericTraitsCheck,
00091     (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
00092 
00094 #endif
00095 
00096 protected:
00097   GradientToMagnitudeImageFilter() {}
00098   virtual ~GradientToMagnitudeImageFilter() {}
00099     
00100 private:
00101   GradientToMagnitudeImageFilter(const Self&); //purposely not implemented
00102   void operator=(const Self&); //purposely not implemented
00103 };
00104  
00105 } // end namespace itk
00106 
00107 
00108 #endif
00109 

Generated at Sat Feb 28 12:30:50 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000