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

itkComplexToModulusImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkComplexToModulusImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-01 14:36:10 $
00007   Version:   $Revision: 1.10 $
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 __itkComplexToModulusImageFilter_h
00018 #define __itkComplexToModulusImageFilter_h
00019 
00020 #include "itkUnaryFunctorImageFilter.h"
00021 #include "vnl/vnl_math.h"
00022 
00023 namespace itk
00024 {
00025   
00031 namespace Function {  
00032   
00033 template< class TInput, class TOutput>
00034 class ComplexToModulus
00035 {
00036 public:
00037   ComplexToModulus() {}
00038   ~ComplexToModulus() {}
00039   bool operator!=( const ComplexToModulus & ) const
00040     {
00041     return false;
00042     }
00043   bool operator==( const ComplexToModulus & other ) const
00044     {
00045     return !(*this != other);
00046     }
00047   inline TOutput operator()( const TInput & A ) const
00048     {
00049     return (TOutput)( vcl_sqrt(A.real() * A.real() + 
00050                                A.imag() * A.imag() ) );
00051     }
00052 };
00053 }
00054 
00055 template <class TInputImage, class TOutputImage>
00056 class ITK_EXPORT ComplexToModulusImageFilter :
00057     public
00058 UnaryFunctorImageFilter<TInputImage,TOutputImage, 
00059                         Function::ComplexToModulus< 
00060   typename TInputImage::PixelType, 
00061   typename TOutputImage::PixelType>   >
00062 {
00063 public:
00065   typedef ComplexToModulusImageFilter  Self;
00066   typedef UnaryFunctorImageFilter<
00067     TInputImage,TOutputImage, 
00068     Function::ComplexToModulus< typename TInputImage::PixelType, 
00069                                 typename TOutputImage::PixelType> >
00070                                        Superclass;
00071   typedef SmartPointer<Self>           Pointer;
00072   typedef SmartPointer<const Self>     ConstPointer;
00073 
00075   itkNewMacro(Self);
00076 
00078   itkTypeMacro(ComplexToModulusImageFilter, 
00079                UnaryFunctorImageFilter);
00080 
00081   typedef typename TInputImage::PixelType                     InputPixelType;
00082   typedef typename TOutputImage::PixelType                    OutputPixelType;
00083   typedef typename NumericTraits< InputPixelType >::ValueType InputPixelValueType;
00084 
00085 
00086 #ifdef ITK_USE_CONCEPT_CHECKING
00087 
00088   itkConceptMacro(InputMultiplyOperatorCheck,
00089     (Concept::MultiplyOperator<InputPixelValueType>));
00090 
00092 #endif
00093 
00094 protected:
00095   ComplexToModulusImageFilter() {}
00096   virtual ~ComplexToModulusImageFilter() {}
00097 
00098 private:
00099   ComplexToModulusImageFilter(const Self&); //purposely not implemented
00100   void operator=(const Self&); //purposely not implemented
00101 
00102 };
00103 
00104 } // end namespace itk
00105 
00106 
00107 #endif
00108 

Generated at Mon Jul 12 2010 18:04:50 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000