00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkImageSliceConstIteratorWithIndex_h
00018 #define __itkImageSliceConstIteratorWithIndex_h
00019
00020 #include "itkImageConstIteratorWithIndex.h"
00021
00022 namespace itk
00023 {
00024
00111 template<typename TImage>
00112 class ITK_EXPORT ImageSliceConstIteratorWithIndex : public ImageConstIteratorWithIndex<TImage>
00113 {
00114 public:
00116 typedef ImageSliceConstIteratorWithIndex Self;
00117 typedef ImageConstIteratorWithIndex<TImage> Superclass;
00118
00123 typedef typename TImage::IndexType IndexType;
00124
00129 typedef TImage ImageType;
00130
00132 typedef typename TImage::RegionType RegionType;
00133
00137 typedef typename TImage::PixelContainer PixelContainer;
00138 typedef typename PixelContainer::Pointer PixelContainerPointer;
00139
00141 ImageSliceConstIteratorWithIndex() : ImageConstIteratorWithIndex<TImage>() {}
00142
00145 ImageSliceConstIteratorWithIndex( const ImageType *ptr,
00146 const RegionType & region)
00147 : ImageConstIteratorWithIndex<TImage>(ptr, region)
00148 {
00149 m_Direction_A = 0;
00150 m_Direction_B = 1;
00151 }
00153
00160 ImageSliceConstIteratorWithIndex( const ImageConstIteratorWithIndex<TImage> &it)
00161 { this->ImageConstIteratorWithIndex<TImage>::operator=(it); }
00162
00165 void NextLine(void);
00166
00169 void NextSlice(void);
00170
00173 void PreviousLine(void);
00174
00177 void PreviousSlice(void);
00178
00180 bool IsAtEndOfLine(void);
00181
00183 bool IsAtEndOfSlice(void);
00184
00186 bool IsAtReverseEndOfLine(void);
00187
00189 bool IsAtReverseEndOfSlice(void);
00190
00192 void SetFirstDirection(unsigned int direction);
00193
00195 void SetSecondDirection(unsigned int direction);
00196
00200 inline Self & operator++();
00201
00205 inline Self & operator--();
00206
00207 private:
00208 unsigned long m_PixelJump;
00209 unsigned long m_LineJump;
00210 unsigned int m_Direction_A;
00211 unsigned int m_Direction_B;
00212 };
00213
00214 }
00215
00216 #ifndef ITK_MANUAL_INSTANTIATION
00217 #include "itkImageSliceConstIteratorWithIndex.txx"
00218 #endif
00219
00220 #endif
00221