00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkComplexToPhaseImageAdaptor_h
00018 #define __itkComplexToPhaseImageAdaptor_h
00019
00020 #include <itkImageAdaptor.h>
00021 #include <complex>
00022
00023 namespace itk
00024 {
00025
00026 namespace Accessor {
00038 template <class TInternalType, class TExternalType >
00039 class ITK_EXPORT ComplexToPhasePixelAccessor
00040 {
00041 public:
00044 typedef TExternalType ExternalType;
00045
00048 typedef TInternalType InternalType;
00049
00050 static inline void Set(TInternalType & output, const TExternalType & input)
00051 {output = (TInternalType)(input);}
00052
00053 static inline TExternalType Get( const TInternalType & input )
00054 {return (TExternalType)( vcl_atan2(input.imag(), input.real() ) );}
00055 };
00056
00057 }
00058
00067 template <class TImage, class TOutputPixelType>
00068 class ITK_EXPORT ComplexToPhaseImageAdaptor : public
00069 ImageAdaptor<TImage,
00070 Accessor::ComplexToPhasePixelAccessor<
00071 typename TImage::PixelType,
00072 TOutputPixelType> >
00073 {
00074 public:
00076 typedef ComplexToPhaseImageAdaptor Self;
00077 typedef ImageAdaptor<TImage, Accessor::ComplexToPhasePixelAccessor<
00078 typename TImage::PixelType,
00079 TOutputPixelType> > Superclass;
00080 typedef SmartPointer<Self> Pointer;
00081 typedef SmartPointer<const Self> ConstPointer;
00082
00084 itkNewMacro(Self);
00085
00087 itkTypeMacro( ComplexToPhaseImageAdaptor, ImageAdaptor );
00088
00089 protected:
00090 ComplexToPhaseImageAdaptor() {}
00091 virtual ~ComplexToPhaseImageAdaptor() {}
00092
00093 private:
00094 ComplexToPhaseImageAdaptor(const Self&);
00095 void operator=(const Self&);
00096
00097 };
00098
00099 }
00100
00101 #endif
00102