00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkComplexToPhaseImageFilter_h
00018 #define __itkComplexToPhaseImageFilter_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 ComplexToPhase
00035 {
00036 public:
00037 ComplexToPhase() {}
00038 ~ComplexToPhase() {}
00039 inline TOutput operator()( const TInput & A )
00040 { return (TOutput)( atan2( A.imag(), A.real() ) );}
00041 };
00042 }
00043
00044 template <class TInputImage, class TOutputImage>
00045 class ITK_EXPORT ComplexToPhaseImageFilter :
00046 public
00047 UnaryFunctorImageFilter<TInputImage,TOutputImage,
00048 Function::ComplexToPhase<
00049 typename TInputImage::PixelType,
00050 typename TOutputImage::PixelType> >
00051 {
00052 public:
00054 typedef ComplexToPhaseImageFilter Self;
00055 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage,
00056 Function::ComplexToPhase< typename TInputImage::PixelType,
00057 typename TOutputImage::PixelType> > Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkNewMacro(Self);
00063
00064 protected:
00065 ComplexToPhaseImageFilter() {}
00066 virtual ~ComplexToPhaseImageFilter() {}
00067
00068 private:
00069 ComplexToPhaseImageFilter(const Self&);
00070 void operator=(const Self&);
00071
00072 };
00073
00074 }
00075
00076
00077 #endif