KWStyle - itkLog10ImageAdaptor.h
 
Matrix View
Description

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

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