00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkPathIterator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-02-19 19:41:23 $ 00007 Version: $Revision: 1.7 $ 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 __itkPathIterator_h 00018 #define __itkPathIterator_h 00019 00020 #include "itkIndex.h" 00021 #include "itkImage.h" 00022 #include "itkPath.h" 00023 #include "itkPathConstIterator.h" 00024 00025 namespace itk 00026 { 00027 00068 template<class TImage, class TPath> 00069 class ITK_EXPORT PathIterator : public PathConstIterator<TImage, TPath> 00070 { 00071 public: 00072 00074 typedef PathIterator Self; 00075 00080 itkStaticConstMacro(ImageIteratorDimension, unsigned int, 00081 TImage::ImageDimension); 00082 00084 typedef PathConstIterator<TImage,TPath> Superclass; 00085 00087 typedef typename Superclass::IndexType IndexType; 00088 typedef typename Superclass::IndexValueType IndexValueType; 00089 typedef typename Superclass::OffsetType OffsetType; 00090 typedef typename Superclass::OffsetValueType OffsetValueType; 00091 typedef typename Superclass::SizeType SizeType; 00092 typedef typename Superclass::SizeValueType SizeValueType; 00093 typedef typename Superclass::RegionType RegionType; 00094 typedef typename Superclass::ImageType ImageType; 00095 typedef typename Superclass::PixelContainer PixelContainer; 00096 typedef typename Superclass::PixelContainerPointer PixelContainerPointer; 00097 typedef typename Superclass::InternalPixelType InternalPixelType; 00098 typedef typename Superclass::PixelType PixelType; 00099 typedef typename Superclass::AccessorType AccessorType; 00100 typedef typename Superclass::PathType PathType; 00101 typedef typename Superclass::PathInputType PathInputType; 00102 typedef typename Superclass::PathOutputType PathOutputType; 00103 00105 itkTypeMacro(PathIterator, PathConstIterator); 00106 00107 00108 00110 void Set( const PixelType & value) 00111 { 00112 // Normally, this would just be the following: 00113 // m_Image->SetPixel(m_CurrentImageIndex,value); 00114 // However, we don't want a warning about m_Image being a ConstPointer 00115 // in the Superclass. 00116 const_cast<ImageType *>(this->m_Image.GetPointer())-> 00117 SetPixel(this->m_CurrentImageIndex,value); 00118 } 00120 00124 PixelType & Value(void) 00125 { 00126 return this->GetImage()->GetPixel(this->m_ImageIndex); 00127 } 00128 00131 Self &operator=(const Self& it); 00132 00134 PathIterator(ImageType *imagePtr, const PathType *pathPtr); 00135 00137 virtual ~PathIterator() {}; 00138 }; 00139 00140 } // end namespace itk 00141 00142 #ifndef ITK_MANUAL_INSTANTIATION 00143 #include "itkPathIterator.txx" 00144 #endif 00145 00146 #endif 00147