00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageRegionIterator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/08/12 14:02:58 $ 00007 Version: $Revision: 1.36 $ 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 __itkImageRegionIterator_h 00018 #define __itkImageRegionIterator_h 00019 00020 #include "itkImageRegionConstIterator.h" 00021 #include "itkImageIteratorWithIndex.h" 00022 00023 namespace itk 00024 { 00025 00072 template<typename TImage> 00073 class ITK_EXPORT ImageRegionIterator : public ImageRegionConstIterator<TImage> 00074 { 00075 public: 00077 typedef ImageRegionIterator Self; 00078 typedef ImageRegionConstIterator<TImage> Superclass; 00079 00081 typedef typename Superclass::IndexType IndexType; 00082 typedef typename Superclass::IndexValueType IndexValueType; 00083 typedef typename Superclass::SizeType SizeType; 00084 typedef typename Superclass::SizeValueType SizeValueType; 00085 typedef typename Superclass::OffsetType OffsetType; 00086 typedef typename Superclass::OffsetValueType OffsetValueType; 00087 typedef typename Superclass::RegionType RegionType; 00088 typedef typename Superclass::ImageType ImageType; 00089 typedef typename Superclass::PixelContainer PixelContainer; 00090 typedef typename Superclass::PixelContainerPointer PixelContainerPointer; 00091 typedef typename Superclass::InternalPixelType InternalPixelType; 00092 typedef typename Superclass::PixelType PixelType; 00093 typedef typename Superclass::AccessorType AccessorType; 00094 00095 00097 ImageRegionIterator(); 00098 00101 ImageRegionIterator(ImageType *ptr, const RegionType& region); 00102 00109 ImageRegionIterator( const ImageIteratorWithIndex<TImage> &it); 00110 00112 void Set( const PixelType & value) const 00113 { 00114 this->m_PixelAccessorFunctor.Set(*(const_cast<InternalPixelType *>( 00115 this->m_Buffer+this->m_Offset)),value); 00116 } 00117 00121 PixelType & Value(void) 00122 { return *(const_cast<InternalPixelType *>(this->m_Buffer+this->m_Offset)); } 00123 00127 Self Begin(void) const; 00128 00132 Self End(void) const; 00133 00134 00135 protected: 00138 ImageRegionIterator( const ImageRegionConstIterator<TImage> &it); 00139 Self & operator=(const ImageRegionConstIterator<TImage> & it); 00140 00141 00142 }; 00143 00144 } // end namespace itk 00145 00146 #ifndef ITK_MANUAL_INSTANTIATION 00147 #include "itkImageRegionIterator.txx" 00148 #endif 00149 00150 #endif 00151 00152 00153