17 #ifndef __itkImageSliceConstIteratorWithIndex_txx
18 #define __itkImageSliceConstIteratorWithIndex_txx
28 template<
class TImage>
34 this->m_PositionIndex[ m_Direction_B ]++;
35 this->m_Position += m_LineJump;
38 this->m_PositionIndex[ m_Direction_A ] = this->m_BeginIndex[ m_Direction_A ];
39 this->m_Position -= m_PixelJump *
40 ( this->m_EndIndex[ m_Direction_A ] - this->m_BeginIndex[ m_Direction_A ] );
46 template<
class TImage>
52 this->m_PositionIndex[ m_Direction_B ]--;
53 this->m_Position -= m_LineJump;
56 this->m_PositionIndex[ m_Direction_A ] = this->m_EndIndex[ m_Direction_A ]-1;
57 this->m_Position += m_PixelJump *
58 ( this->m_EndIndex[ m_Direction_A ] - this->m_BeginIndex[ m_Direction_A ] );
64 template<
class TImage>
70 this->m_PositionIndex[m_Direction_B] = this->m_BeginIndex[m_Direction_B];
71 this->m_Position -= m_LineJump *
72 ( this->m_EndIndex[ m_Direction_B ] - this->m_BeginIndex[ m_Direction_B ] );
80 template<
class TImage>
87 this->m_Position -= m_LineJump *
88 ( this->m_PositionIndex[ m_Direction_B ] - this->m_BeginIndex[ m_Direction_B ] );
89 this->m_PositionIndex[m_Direction_B] = this->m_BeginIndex[m_Direction_B];
91 for(
unsigned int n=0; n<TImage::ImageDimension; n++ )
94 this->m_Remaining =
false;
96 if( n == m_Direction_B || n == m_Direction_A )
101 this->m_PositionIndex[ n ]++;
102 if( this->m_PositionIndex[n] < this->m_EndIndex[n] )
104 this->m_Position += this->m_OffsetTable[ n ];
105 this->m_Remaining =
true;
110 this->m_Position -= this->m_OffsetTable[ n+1 ] - this->m_OffsetTable[ n ];
111 this->m_PositionIndex[ n ] = this->m_BeginIndex[ n ];
119 template<
class TImage>
126 this->m_PositionIndex[m_Direction_B] = this->m_EndIndex[m_Direction_B] - 1;
127 this->m_Position += m_LineJump *
128 ( this->m_EndIndex[ m_Direction_B ] - this->m_BeginIndex[ m_Direction_B ] );
131 for(
unsigned int n=0; n<TImage::ImageDimension; n++ )
134 this->m_Remaining =
false;
136 if( n == m_Direction_B || n == m_Direction_A )
141 this->m_PositionIndex[ n ]--;
142 if( this->m_PositionIndex[n] >= this->m_BeginIndex[n] )
144 this->m_Position -= this->m_OffsetTable[ n ];
145 this->m_Remaining =
true;
150 this->m_Position += this->m_OffsetTable[ n+1 ] - this->m_OffsetTable[ n ];
151 this->m_PositionIndex[ n ] = this->m_EndIndex[ n ] - 1;
159 template<
class TImage>
164 return this->m_PositionIndex[m_Direction_A] >= this->m_EndIndex[m_Direction_A];
170 template<
class TImage>
175 return this->m_PositionIndex[m_Direction_B] >= this->m_EndIndex[m_Direction_B];
181 template<
class TImage>
186 return this->m_PositionIndex[m_Direction_A] < this->m_BeginIndex[m_Direction_A];
192 template<
class TImage>
197 return this->m_PositionIndex[m_Direction_B] < this->m_BeginIndex[m_Direction_B];
203 template<
class TImage>
208 if( direction >= TImage::ImageDimension )
210 itkGenericExceptionMacro(<<
"In image of dimension " << TImage::ImageDimension <<
" Direction " << direction <<
" sas selected");
212 m_Direction_A = direction;
213 m_PixelJump = this->m_OffsetTable[ m_Direction_A ];
219 template<
class TImage>
224 if( direction >= TImage::ImageDimension )
226 itkGenericExceptionMacro(<<
"In image of dimension " << TImage::ImageDimension <<
" Direction " << direction <<
" sas selected");
228 m_Direction_B = direction;
229 m_LineJump = this->m_OffsetTable[ m_Direction_B ];
235 template<
class TImage>
240 this->m_PositionIndex[ m_Direction_A ]++;
241 this->m_Position += m_PixelJump;
248 template<
class TImage>
253 this->m_PositionIndex[ m_Direction_A ]--;
254 this->m_Position -= m_PixelJump;