00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkAddImageAdaptor.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:00 $ 00007 Version: $Revision: 1.2 $ 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 __itkAddImageAdaptor_h 00018 #define __itkAddImageAdaptor_h 00019 00020 #include "itkImageAdaptor.h" 00021 #include "itkAddPixelAccessor.h" 00022 00023 namespace itk 00024 { 00025 00034 template <class TImage> 00035 class ITK_EXPORT AddImageAdaptor : public 00036 ImageAdaptor<TImage, 00037 Accessor::AddPixelAccessor< typename TImage::PixelType > > 00038 { 00039 public: 00041 typedef AddImageAdaptor Self; 00042 typedef ImageAdaptor<TImage, 00043 Accessor::AddPixelAccessor< 00044 typename TImage::PixelType > > Superclass; 00045 typedef SmartPointer<Self> Pointer; 00046 typedef SmartPointer<const Self> ConstPointer; 00047 00048 typedef typename TImage::PixelType PixelType; 00049 00051 itkTypeMacro( AddImageAdaptor, ImageAdaptor ); 00052 00054 itkNewMacro(Self); 00055 00057 void SetValue( const PixelType newvalue ) 00058 { this->GetPixelAccessor().SetValue( newvalue ); } 00059 00061 PixelType GetValue() const 00062 { return this->GetPixelAccessor().GetValue(); } 00063 00064 protected: 00065 AddImageAdaptor() {} 00066 virtual ~AddImageAdaptor() {} 00067 00068 private: 00069 AddImageAdaptor(const Self&); //purposely not implemented 00070 void operator=(const Self&); //purposely not implemented 00071 }; 00072 00073 } // end namespace itk 00074 00075 #endif