18 #ifndef itkImageLinearConstIteratorWithIndex_h
19 #define itkImageLinearConstIteratorWithIndex_h
100 template <
typename TImage>
171 GoToReverseBeginOfLine();
182 return this->m_PositionIndex[m_Direction] >= this->m_EndIndex[m_Direction];
189 return this->m_PositionIndex[m_Direction] < this->m_BeginIndex[m_Direction];
196 if (direction >= TImage::ImageDimension)
198 itkGenericExceptionMacro(<<
"In image of dimension " << TImage::ImageDimension <<
" Direction " << direction
201 m_Direction = direction;
202 m_Jump = this->m_OffsetTable[m_Direction];
218 this->m_PositionIndex[m_Direction]++;
219 this->m_Position += m_Jump;
229 this->m_PositionIndex[m_Direction]--;
230 this->m_Position -= m_Jump;
237 unsigned int m_Direction{ 0 };
243 template <
typename TImage>
248 this->m_OffsetTable[m_Direction] * (this->m_PositionIndex[m_Direction] - this->m_BeginIndex[m_Direction]);
250 this->m_PositionIndex[m_Direction] = this->m_BeginIndex[m_Direction];
252 for (
unsigned int n = 0; n < TImage::ImageDimension; n++)
254 this->m_Remaining =
false;
256 if (n == m_Direction)
261 this->m_PositionIndex[n]++;
262 if (this->m_PositionIndex[n] < this->m_EndIndex[n])
264 this->m_Position += this->m_OffsetTable[n];
265 this->m_Remaining =
true;
270 this->m_Position -= this->m_OffsetTable[n] * (this->m_Region.GetSize()[n] - 1);
271 this->m_PositionIndex[n] = this->m_BeginIndex[n];
279 template <
typename TImage>
284 this->m_OffsetTable[m_Direction] * (this->m_EndIndex[m_Direction] - 1 - this->m_PositionIndex[m_Direction]);
286 this->m_PositionIndex[m_Direction] = this->m_EndIndex[m_Direction] - 1;
288 for (
unsigned int n = 0; n < TImage::ImageDimension; n++)
290 this->m_Remaining =
false;
292 if (n == m_Direction)
297 this->m_PositionIndex[n]--;
298 if (this->m_PositionIndex[n] >= this->m_BeginIndex[n])
300 this->m_Position -= this->m_OffsetTable[n];
301 this->m_Remaining =
true;
306 this->m_Position += this->m_OffsetTable[n] * (this->m_Region.GetSize()[n] - 1);
307 this->m_PositionIndex[n] = this->m_EndIndex[n] - 1;
313 #ifndef ITK_MANUAL_INSTANTIATION
314 # include "itkImageLinearConstIteratorWithIndex.hxx"