00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkLineIterator_h
00018 #define __itkLineIterator_h
00019
00020 #include "itkIndex.h"
00021 #include "itkImage.h"
00022 #include "itkLineConstIterator.h"
00023
00024 namespace itk
00025 {
00026
00051 template<class TImage>
00052 class ITK_EXPORT LineIterator : public LineConstIterator<TImage>
00053 {
00054 public:
00055
00057 typedef LineIterator Self;
00058
00063 itkStaticConstMacro(ImageIteratorDimension, unsigned int,
00064 TImage::ImageDimension);
00065
00067 typedef LineConstIterator<TImage> Superclass;
00068
00070 typedef typename Superclass::IndexType IndexType;
00071 typedef typename Superclass::IndexValueType IndexValueType;
00072 typedef typename Superclass::OffsetType OffsetType;
00073 typedef typename Superclass::OffsetValueType OffsetValueType;
00074 typedef typename Superclass::SizeType SizeType;
00075 typedef typename Superclass::SizeValueType SizeValueType;
00076 typedef typename Superclass::RegionType RegionType;
00077 typedef typename Superclass::ImageType ImageType;
00078 typedef typename Superclass::PixelContainer PixelContainer;
00079 typedef typename Superclass::PixelContainerPointer PixelContainerPointer;
00080 typedef typename Superclass::InternalPixelType InternalPixelType;
00081 typedef typename Superclass::PixelType PixelType;
00082 typedef typename Superclass::AccessorType AccessorType;
00083
00085 itkTypeMacro(LineIterator, LineConstIterator);
00086
00088 void Set( const PixelType & value)
00089 {
00090
00091
00092
00093
00094 const_cast<ImageType *>(this->m_Image.GetPointer())->
00095 SetPixel(this->m_CurrentImageIndex,value);
00096 }
00098
00102 const PixelType & Value(void)
00103 {
00104 return (this->m_Image->GetPixel(this->m_CurrentImageIndex));
00105 }
00106
00109 Self &operator=(const Self& it);
00110
00112 LineIterator(ImageType *imagePtr, const IndexType &firstIndex,
00113 const IndexType &lastIndex);
00114
00116 virtual ~LineIterator() {};
00117 };
00118
00119 }
00120
00121
00122 #define ITK_TEMPLATE_LineIterator(_, EXPORT, x, y) namespace itk { \
00123 _(1(class EXPORT LineIterator< ITK_TEMPLATE_1 x >)) \
00124 namespace Templates { typedef LineIterator< ITK_TEMPLATE_1 x > \
00125 LineIterator##y; } \
00126 }
00127
00128 #if ITK_TEMPLATE_EXPLICIT
00129 # include "Templates/itkLineIterator+-.h"
00130 #endif
00131
00132 #if ITK_TEMPLATE_TXX
00133 # include "itkLineIterator.txx"
00134 #endif
00135
00136 #endif
00137