00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkImageIterator_h
00018 #define __itkImageIterator_h
00019
00020 #include "itkImageConstIterator.h"
00021
00022 namespace itk
00023 {
00024
00062 template<typename TImage>
00063 class ITK_EXPORT ImageIterator : public ImageConstIterator<TImage>
00064 {
00065 public:
00066
00068 typedef ImageIterator Self;
00069
00074 itkStaticConstMacro(ImageIteratorDimension, unsigned int,
00075 TImage::ImageDimension);
00076
00078 typedef ImageConstIterator<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
00098 ImageIterator();
00099
00101 ~ImageIterator() {};
00102
00103
00106 ImageIterator(const Self& it);
00107
00110 ImageIterator(TImage *ptr, const RegionType& region);
00111
00114 Self &operator=(const Self& it);
00115
00117 void Set( const PixelType & value) const
00118 {
00119 this->m_PixelAccessorFunctor.Set(*(const_cast<InternalPixelType *>
00120 (this->m_Buffer)+this->m_Offset), value);
00121 }
00122
00126 PixelType & Value(void)
00127 { return *(const_cast<InternalPixelType *>(this->m_Buffer)+this->m_Offset); }
00128
00132 Self Begin(void) const;
00133
00137 Self End(void) const;
00138
00140 ImageType * GetImage() const
00141 { return const_cast<ImageType *>( this->m_Image.GetPointer() ); };
00142
00143
00144 protected:
00145
00147 ImageIterator(const ImageConstIterator<TImage> & it);
00148 Self &operator=(const ImageConstIterator<TImage> & it);
00149 };
00151
00152 }
00153
00154
00155 #define ITK_TEMPLATE_ImageIterator(_, EXPORT, x, y) namespace itk { \
00156 _(1(class EXPORT ImageIterator< ITK_TEMPLATE_1 x >)) \
00157 namespace Templates { typedef ImageIterator< ITK_TEMPLATE_1 x > \
00158 ImageIterator##y; } \
00159 }
00160
00161 #if ITK_TEMPLATE_EXPLICIT
00162 # include "Templates/itkImageIterator+-.h"
00163 #endif
00164
00165 #if ITK_TEMPLATE_TXX
00166 # include "itkImageIterator.txx"
00167 #endif
00168
00169 #endif
00170