Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkAbsImageAdaptor.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkAbsImageAdaptor.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/11/05 17:55:37 $ 00007 Version: $Revision: 1.1 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkAbsImageAdaptor_h 00018 #define __itkAbsImageAdaptor_h 00019 00020 #include <itkImageAdaptor.h> 00021 00022 namespace itk 00023 { 00024 00025 namespace Accessor { 00036 template <class TInternalType, class TExternalType > 00037 class ITK_EXPORT AbsPixelAccessor 00038 { 00039 public: 00042 typedef TExternalType ExternalType; 00043 00046 typedef TInternalType InternalType; 00047 00048 static inline void Set(TInternalType & output, const TExternalType & input) 00049 {output = (TInternalType)((input > NumericTraits<TExternalType>::Zero) ? input : -input );} 00050 00051 static inline TExternalType Get( const TInternalType & input ) 00052 {return (TExternalType) ( (input > NumericTraits<TInternalType>::Zero) ? input : -input );} 00053 }; 00054 00055 } // end namespace Accessor 00056 00065 template <class TImage, class TOutputPixelType> 00066 class ITK_EXPORT AbsImageAdaptor : public 00067 ImageAdaptor<TImage, 00068 Accessor::AbsPixelAccessor< 00069 typename TImage::PixelType, 00070 TOutputPixelType> > 00071 { 00072 public: 00074 typedef AbsImageAdaptor Self; 00075 typedef ImageAdaptor<TImage, Accessor::AbsPixelAccessor< 00076 typename TImage::PixelType, 00077 TOutputPixelType> > Superclass; 00078 typedef SmartPointer<Self> Pointer; 00079 typedef SmartPointer<const Self> ConstPointer; 00080 00082 itkNewMacro(Self); 00083 00085 itkTypeMacro( AbsImageAdaptor, ImageAdaptor ); 00086 00087 protected: 00088 AbsImageAdaptor() {} 00089 virtual ~AbsImageAdaptor() {} 00090 00091 private: 00092 AbsImageAdaptor(const Self&); //purposely not implemented 00093 void operator=(const Self&); //purposely not implemented 00094 00095 }; 00096 00097 } // end namespace itk 00098 00099 #endif

Generated at Sun Apr 1 02:24:01 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000