18 #ifndef itkImageRegionReverseConstIterator_h
19 #define itkImageRegionReverseConstIterator_h
102 template <
typename TImage>
152 m_SpanBeginOffset = 0;
162 m_SpanBeginOffset = this->m_BeginOffset;
163 m_SpanEndOffset = this->m_BeginOffset - static_cast<OffsetValueType>(this->m_Region.GetSize()[0]);
179 m_SpanBeginOffset = this->m_Offset + static_cast<OffsetValueType>(this->m_Region.GetSize()[0]) -
180 (ind[0] - this->m_Region.GetIndex()[0]);
181 m_SpanEndOffset = m_SpanBeginOffset - static_cast<OffsetValueType>(this->m_Region.GetSize()[0]);
191 m_SpanBeginOffset = this->m_Offset + static_cast<OffsetValueType>(this->m_Region.GetSize()[0]) -
192 (ind[0] - this->m_Region.GetIndex()[0]);
193 m_SpanEndOffset = m_SpanBeginOffset - static_cast<OffsetValueType>(this->m_Region.GetSize()[0]);
203 m_SpanBeginOffset = this->m_Offset + static_cast<OffsetValueType>(this->m_Region.GetSize()[0]) -
204 (ind[0] - this->m_Region.GetIndex()[0]);
205 m_SpanEndOffset = m_SpanBeginOffset - static_cast<OffsetValueType>(this->m_Region.GetSize()[0]);
213 Superclass::GoToBegin();
216 m_SpanBeginOffset = this->m_BeginOffset;
217 m_SpanEndOffset = this->m_BeginOffset - static_cast<OffsetValueType>(this->m_Region.GetSize()[0]);
225 Superclass::GoToEnd();
228 m_SpanEndOffset = this->m_EndOffset;
229 m_SpanBeginOffset = m_SpanEndOffset + static_cast<OffsetValueType>(this->m_Region.GetSize()[0]);
238 Superclass::SetIndex(ind);
239 m_SpanBeginOffset = this->m_Offset + static_cast<OffsetValueType>(this->m_Region.GetSize()[0]) -
240 (ind[0] - this->m_Region.GetIndex()[0]);
241 m_SpanEndOffset = m_SpanBeginOffset - static_cast<OffsetValueType>(this->m_Region.GetSize()[0]);
256 if (--this->m_Offset <= m_SpanEndOffset)
266 this->m_Image->ComputeIndex(static_cast<OffsetValueType>(this->m_Offset));
277 done = (--ind[0] == startIndex[0] - 1);
278 for (
unsigned int i = 1; done && i < this->ImageIteratorDimension; ++i)
280 done = (ind[i] == startIndex[i]);
288 while ((dim < this->ImageIteratorDimension - 1) && (ind[dim] < startIndex[dim]))
290 ind[dim] = startIndex[dim] + static_cast<OffsetValueType>(size[dim]) - 1;
294 this->m_Offset = this->m_Image->ComputeOffset(ind);
295 m_SpanBeginOffset = this->m_Offset;
296 m_SpanEndOffset = m_SpanBeginOffset - static_cast<OffsetValueType>(size[0]);
312 if (++this->m_Offset >= m_SpanBeginOffset)
322 this->m_Image->ComputeIndex(static_cast<OffsetValueType>(this->m_Offset));
333 done = (++ind[0] == startIndex[0] + static_cast<OffsetValueType>(size[0]));
334 for (
unsigned int i = 1; done && i < this->ImageIteratorDimension; ++i)
336 done = (ind[i] == startIndex[i] + static_cast<OffsetValueType>(size[i]) - 1);
344 while ((dim < this->ImageIteratorDimension - 1) &&
345 (ind[dim] > startIndex[dim] + static_cast<OffsetValueType>(size[dim]) - 1))
347 ind[dim] = startIndex[dim];
351 this->m_Offset = this->m_Image->ComputeOffset(ind);
352 m_SpanBeginOffset = this->m_Offset;
353 m_SpanEndOffset = this->m_Offset - static_cast<OffsetValueType>(size[0]);