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

itkMagnitudeAndPhaseToComplexImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMagnitudeAndPhaseToComplexImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-06-29 20:44:09 $
00007   Version:   $Revision: 1.2 $
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 
00018 #ifndef __itkMagnitudeAndPhaseToComplexImageFilter_h
00019 #define __itkMagnitudeAndPhaseToComplexImageFilter_h
00020 
00021 #include "itkBinaryFunctorImageFilter.h"
00022 
00023 namespace itk
00024 {
00052 namespace Functor {  
00053   
00054 template< class TInput1, class TInput2, class TOutput>
00055 class MagnitudeAndPhaseToComplex
00056 {
00057 public:
00058   MagnitudeAndPhaseToComplex() {};
00059   ~MagnitudeAndPhaseToComplex() {};
00060   bool operator!=( const MagnitudeAndPhaseToComplex & ) const
00061     {
00062     return false;
00063     }
00064   bool operator==( const MagnitudeAndPhaseToComplex & other ) const
00065     {
00066     return !(*this != other);
00067     }
00068   inline std::complex<TOutput> operator()( const TInput1 & A, const TInput2 & B)
00069     {
00070     return std::complex<TOutput>(std::polar(static_cast<TOutput>(A),  static_cast<TOutput>(B)) );
00071     }
00072 }; 
00073 }
00074 
00075 template <class TInputPixel1, class TInputPixel2, class TOutputPixel, unsigned int NDimension = 3>
00076 class ITK_EXPORT MagnitudeAndPhaseToComplexImageFilter :
00077     public BinaryFunctorImageFilter<
00078        Image < TInputPixel1, NDimension >,
00079        Image < TInputPixel2, NDimension >,
00080        Image < std::complex<TOutputPixel>, NDimension >, 
00081                          Functor::MagnitudeAndPhaseToComplex< 
00082             TInputPixel1, 
00083             TInputPixel2,
00084             TOutputPixel
00085                  >
00086       >
00087 {
00088 public:
00090   typedef MagnitudeAndPhaseToComplexImageFilter  Self;
00091 
00092   typedef BinaryFunctorImageFilter<
00093        Image < TInputPixel1, NDimension >,
00094        Image < TInputPixel2, NDimension >,
00095        Image < std::complex<TOutputPixel>, NDimension >, 
00096          Functor::MagnitudeAndPhaseToComplex< 
00097             TInputPixel1, 
00098             TInputPixel2,
00099             TOutputPixel > >                     Superclass;
00100 
00101   typedef SmartPointer<Self>                     Pointer;
00102   typedef SmartPointer<const Self>               ConstPointer;
00103 
00105   itkNewMacro(Self);
00106 
00107 #ifdef ITK_USE_CONCEPT_CHECKING
00108 
00109   itkConceptMacro(Input1ConvertibleToDoubleCheck,
00110     (Concept::Convertible<TInputPixel1, double>));
00111   itkConceptMacro(Input2ConvertibleToDoubleCheck,
00112     (Concept::Convertible<TInputPixel2, double>));
00113   itkConceptMacro(DoubleConvertibleToOutputCheck,
00114     (Concept::Convertible<double, TOutputPixel>));
00115 
00117 #endif
00118 
00119 protected:
00120   MagnitudeAndPhaseToComplexImageFilter() {}
00121   virtual ~MagnitudeAndPhaseToComplexImageFilter() {}
00122 
00123 private:
00124   MagnitudeAndPhaseToComplexImageFilter(const Self&); //purposely not implemented
00125   void operator=(const Self&); //purposely not implemented
00126 
00127 };
00128 
00129 } // end namespace itk
00130 
00131 
00132 #endif
00133 

Generated at Tue Jul 29 21:08:05 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000