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
00058 template<typename TImage>
00059 class ITK_EXPORT ImageSliceConstIteratorWithIndex : public ImageConstIteratorWithIndex<TImage>
00060 {
00061 public:
00063 typedef ImageSliceConstIteratorWithIndex Self;
00064 typedef ImageConstIteratorWithIndex<TImage> Superclass;
00065
00070 typedef typename TImage::IndexType IndexType;
00071
00076 typedef TImage ImageType;
00077
00079 typedef typename TImage::RegionType RegionType;
00080
00084 typedef typename TImage::PixelContainer PixelContainer;
00085 typedef typename PixelContainer::Pointer PixelContainerPointer;
00086
00088 ImageSliceConstIteratorWithIndex() : ImageConstIteratorWithIndex<TImage>() {}
00089
00092 ImageSliceConstIteratorWithIndex( const ImageType *ptr,
00093 const RegionType & region)
00094 : ImageConstIteratorWithIndex<TImage>(ptr, region)
00095 {
00096 m_Direction_A = 0;
00097 m_Direction_B = 1;
00098 }
00099
00106 ImageSliceConstIteratorWithIndex( const ImageConstIteratorWithIndex<TImage> &it)
00107 { this->ImageConstIteratorWithIndex<TImage>::operator=(it); }
00108
00111 void NextLine(void);
00112
00115 void NextSlice(void);
00116
00119 void PreviousLine(void);
00120
00123 void PreviousSlice(void);
00124
00126 bool IsAtEndOfLine(void);
00127
00129 bool IsAtEndOfSlice(void);
00130
00132 bool IsAtReverseEndOfLine(void);
00133
00135 bool IsAtReverseEndOfSlice(void);
00136
00138 void SetFirstDirection(unsigned int direction);
00139
00141 void SetSecondDirection(unsigned int direction);
00142
00146 Self & operator++();
00147
00151 Self & operator--();
00152
00153 private:
00154 unsigned long m_PixelJump;
00155 unsigned long m_LineJump;
00156 unsigned int m_Direction_A;
00157 unsigned int m_Direction_B;
00158 };
00159
00160 }
00161
00162 #ifndef ITK_MANUAL_INSTANTIATION
00163 #include "itkImageSliceConstIteratorWithIndex.txx"
00164 #endif
00165
00166 #endif