KWStyle - itkAtanImageAdaptor.h
 
Matrix View
Description

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

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