Orfeo Toolbox  3.16
itkAbsImageAdaptor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkAbsImageAdaptor.h,v $
5  Language: C++
6  Date: $Date: 2009-09-19 19:56:20 $
7  Version: $Revision: 1.5 $
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 __itkAbsImageAdaptor_h
18 #define __itkAbsImageAdaptor_h
19 
20 #include <itkImageAdaptor.h>
21 
22 namespace itk
23 {
24 
25 namespace Accessor {
36 template <class TInternalType, class TExternalType >
38 {
39 public:
42  typedef TExternalType ExternalType;
43 
46  typedef TInternalType InternalType;
47 
48  static inline void Set(TInternalType & output, const TExternalType & input)
49  {output = (TInternalType)(
50  (input > NumericTraits<TExternalType>::Zero) ? input : -input );}
51 
52  static inline TExternalType Get( const TInternalType & input )
53  {return (TExternalType) (
54  (input > NumericTraits<TInternalType>::Zero) ? input : -input );}
55 };
56 
57 } // end namespace Accessor
58 
67 template <class TImage, class TOutputPixelType>
69  ImageAdaptor<TImage,
70  Accessor::AbsPixelAccessor<
71  typename TImage::PixelType,
72  TOutputPixelType> >
73 {
74 public:
78  typename TImage::PixelType,
79  TOutputPixelType> > Superclass;
82 
84  itkNewMacro(Self);
85 
87  itkTypeMacro( AbsImageAdaptor, ImageAdaptor );
88 
89 protected:
91  virtual ~AbsImageAdaptor() {}
92 
93 private:
94  AbsImageAdaptor(const Self&); //purposely not implemented
95  void operator=(const Self&); //purposely not implemented
96 
97 };
98 
99 } // end namespace itk
100 
101 #endif

Generated at Sat Feb 2 2013 23:22:54 for Orfeo Toolbox with doxygen 1.8.1.1