KWStyle - itkComplexToRealImageAdaptor.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkComplexToRealImageAdaptor.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:34 $
7   Version:   $Revision: 1.4 $
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 __itkComplexToRealImageAdaptor_h
18 #define __itkComplexToRealImageAdaptor_h
19
20 #include <itkImageAdaptor.h>
21 #include <complex>
22
23 namespace itk
24 {
25  
26 namespace Accessor {
27 /** \class ComplexToRealPixelAccessor
28  * \brief Give access to the Real part of a std::complex<> value 
29  *
30  * ComplexToRealPixelAccessor is templated over an internal type and an
31  * external type representation. The internal type is an std::complex<T> and
32  * the external part is a type T. This class cast the input applies the funtion
33  * to it and cast the result according to the types defined as template
34  * parameters
35  *
36  * \ingroup ImageAdaptors
37  */
38 template <class TInternalType, class TExternalType >
39 class ITK_EXPORT ComplexToRealPixelAccessor  
40 {
41 public:
42   /** External typedef. It defines the external aspect
43    * that this class will exhibit. */
44   typedef TExternalType ExternalType;
45
46   /** Internal typedef. It defines the internal real
47    * representation of data. */
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)(input.real());}
55 };
56   
57 // end namespace Accessor
58  
59 /** \class ComplexToRealImageAdaptor
60 LEN  * \brief Presents a complex image as being composed of real() part of its pixels
61  *
62  * Additional casting is performed according to the input and output image
63  * types following C++ default casting rules.
64  *
65  * \ingroup ImageAdaptors
66  */
67 template <class TImage, class TOutputPixelType>
68 class ITK_EXPORT ComplexToRealImageAdaptor : public
69 IND ******ImageAdaptor<TImage,
70                    Accessor::ComplexToRealPixelAccessor<
71                                       typename TImage::PixelType,
72                                       TOutputPixelType>   >
73 {
74 public:
75   /** Standard class typedefs. */
76   typedef ComplexToRealImageAdaptor  Self;
77   typedef ImageAdaptor<TImage, Accessor::ComplexToRealPixelAccessor<
78                                typename TImage::PixelType,
79 TDA                                TOutputPixelType> >  Superclass;
80 TDA   typedef SmartPointer<Self>  Pointer;
81 TDA   typedef SmartPointer<const Self>  ConstPointer;
82   
83   /** Method for creation through the object factory. */
84   itkNewMacro(Self);  
85
86   /** Run-time type information (and related methods). */
87   itkTypeMacro( ComplexToRealImageAdaptor, ImageAdaptor );
88
89 IND *protected:
90   ComplexToRealImageAdaptor() {}
91   virtual ~ComplexToRealImageAdaptor() {}
92   
93 IND *private:
94   ComplexToRealImageAdaptor(const Self&); //purposely not implemented
95   void operator=(const Self&); //purposely not implemented
96
97 };
98
99 // end namespace itk
100
101 #endif
102

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:02PM
© Kitware Inc.