Orfeo Toolbox  3.16
itkComplexToModulusImageAdaptor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkComplexToModulusImageAdaptor.h,v $
5  Language: C++
6  Date: $Date: 2009-09-19 19:56:20 $
7  Version: $Revision: 1.6 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkComplexToModulusImageAdaptor_h
18 #define __itkComplexToModulusImageAdaptor_h
19 
20 #include <itkImageAdaptor.h>
21 #include <complex>
22 
23 namespace itk
24 {
25 
26 namespace Accessor {
38 template <class TInternalType, class TExternalType >
40 {
41 public:
44  typedef TExternalType ExternalType;
45 
48  typedef TInternalType InternalType;
49 
50  static inline void Set(TInternalType & output, const TExternalType & input)
51  {output = (TInternalType)(input);}
52 
53  static inline TExternalType Get( const TInternalType & input )
54  {return (TExternalType)( vcl_sqrt(input.real() * input.real() +
55  input.imag() * input.imag() ) ); }
56 };
57 
58 } // end namespace Accessor
59 
69 template <class TImage, class TOutputPixelType>
71  ImageAdaptor<TImage,
72  Accessor::ComplexToModulusPixelAccessor<
73  typename TImage::PixelType,
74  TOutputPixelType> >
75 {
76 public:
80  typename TImage::PixelType,
81  TOutputPixelType> > Superclass;
84 
86  itkNewMacro(Self);
87 
90 
91 protected:
94 
95 private:
96  ComplexToModulusImageAdaptor(const Self&); //purposely not implemented
97  void operator=(const Self&); //purposely not implemented
98 
99 };
100 
101 } // end namespace itk
102 
103 #endif

Generated at Sat May 18 2013 23:33:55 for Orfeo Toolbox with doxygen 1.8.3.1