18 #ifndef itkImageRegionReverseConstIterator_h
19 #define itkImageRegionReverseConstIterator_h
102 template<
typename TImage >
151 m_SpanBeginOffset = 0;
160 m_SpanBeginOffset = this->m_BeginOffset;
161 m_SpanEndOffset = this->m_BeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
176 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
177 - ( ind[0] - this->m_Region.GetIndex()[0] );
178 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
187 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
188 - ( ind[0] - this->m_Region.GetIndex()[0] );
189 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
198 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
199 - ( ind[0] - this->m_Region.GetIndex()[0] );
200 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
207 Superclass::GoToBegin();
210 m_SpanBeginOffset = this->m_BeginOffset;
211 m_SpanEndOffset = this->m_BeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
218 Superclass::GoToEnd();
221 m_SpanEndOffset = this->m_EndOffset;
222 m_SpanBeginOffset = m_SpanEndOffset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
230 Superclass::SetIndex(ind);
231 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
232 - ( ind[0] - this->m_Region.GetIndex()[0] );
233 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
248 if ( --this->m_Offset <= m_SpanEndOffset )
258 ind = this->m_Image->ComputeIndex( static_cast< OffsetValueType >( this->m_Offset ) );
261 startIndex = this->m_Region.
GetIndex();
263 size = this->m_Region.GetSize();
271 done = ( --ind[0] == startIndex[0] - 1 );
272 for (
unsigned int i = 1; done && i < this->ImageIteratorDimension; i++ )
274 done = ( ind[i] == startIndex[i] );
282 while ( ( dim < this->ImageIteratorDimension - 1 )
283 && ( ind[dim] < startIndex[dim] ) )
285 ind[dim] = startIndex[dim] +
static_cast< OffsetValueType >( size[dim] ) - 1;
289 this->m_Offset = this->m_Image->ComputeOffset(ind);
290 m_SpanBeginOffset = this->m_Offset;
291 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( size[0] );
306 if ( ++this->m_Offset >= m_SpanBeginOffset )
316 ind = this->m_Image->ComputeIndex( static_cast< OffsetValueType >( this->m_Offset ) );
319 startIndex = this->m_Region.
GetIndex();
321 size = this->m_Region.GetSize();
329 done = ( ++ind[0] == startIndex[0] +
static_cast< OffsetValueType >( size[0] ) );
330 for (
unsigned int i = 1; done && i < this->ImageIteratorDimension; i++ )
332 done = ( ind[i] == startIndex[i] +
static_cast< OffsetValueType >( size[i] ) - 1 );
340 while ( ( dim < this->ImageIteratorDimension - 1 )
341 && ( ind[dim] > startIndex[dim] +
static_cast< OffsetValueType >( size[dim] ) - 1 ) )
343 ind[dim] = startIndex[dim];
347 this->m_Offset = this->m_Image->ComputeOffset(ind);
348 m_SpanBeginOffset = this->m_Offset;
349 m_SpanEndOffset = this->m_Offset -
static_cast< OffsetValueType >( size[0] );
typename PixelContainer::Pointer PixelContainerPointer
const IndexType GetIndex()
SizeValueType m_SpanEndOffset
typename Superclass::PixelContainer PixelContainer
typename Superclass::PixelType PixelType
unsigned long SizeValueType
ImageRegionReverseConstIterator(const ImageReverseConstIterator< TImage > &it)
typename Superclass::OffsetType OffsetType
typename Superclass::RegionType RegionType
A multi-dimensional image iterator designed to walk a specified image region in reverse.
typename Superclass::AccessorType AccessorType
typename TImage::PixelContainer PixelContainer
typename TImage::AccessorType AccessorType
ImageRegionReverseConstIterator(const ImageConstIterator< TImage > &it)
A multi-dimensional image iterator templated over image type.
typename TImage::InternalPixelType InternalPixelType
typename Superclass::SizeType SizeType
ImageRegionReverseConstIterator(const ImageRegionIterator< TImage > &it)
typename Superclass::IndexType IndexType
ImageBaseType::SizeType SizeType
typename TImage::PixelType PixelType
ImageRegionReverseConstIterator()
typename Superclass::SizeType SizeType
ImageBaseType::IndexType IndexType
typename TImage::IndexType IndexType
typename Superclass::IndexType IndexType
typename Superclass::InternalPixelType InternalPixelType
Multi-dimensional image iterator.
typename TImage::OffsetType OffsetType
typename TImage::SizeType SizeType
SizeValueType m_SpanBeginOffset
ImageRegionReverseConstIterator(const ImageType *ptr, const RegionType ®ion)
ImageBaseType::RegionType RegionType
signed long OffsetValueType
A multi-dimensional iterator templated over image type that walks a region of pixels.
typename Superclass::ImageType ImageType
void SetIndex(const IndexType &ind) override