18 #ifndef itkImageRegionReverseConstIterator_h
19 #define itkImageRegionReverseConstIterator_h
102 template<
typename TImage >
152 m_SpanBeginOffset = 0;
161 m_SpanBeginOffset = this->m_BeginOffset;
162 m_SpanEndOffset = this->m_BeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
177 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
178 - ( ind[0] - this->m_Region.GetIndex()[0] );
179 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
188 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
189 - ( ind[0] - this->m_Region.GetIndex()[0] );
190 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
199 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
200 - ( ind[0] - this->m_Region.GetIndex()[0] );
201 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
208 Superclass::GoToBegin();
211 m_SpanBeginOffset = this->m_BeginOffset;
212 m_SpanEndOffset = this->m_BeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
219 Superclass::GoToEnd();
222 m_SpanEndOffset = this->m_EndOffset;
223 m_SpanBeginOffset = m_SpanEndOffset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
229 itkLegacyMacro(Self Begin(
void)
const);
235 itkLegacyMacro(Self End(
void)
const);
242 Superclass::SetIndex(ind);
243 m_SpanBeginOffset = this->m_Offset +
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] )
244 - ( ind[0] - this->m_Region.GetIndex()[0] );
245 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( this->m_Region.GetSize()[0] );
260 if ( --this->m_Offset <= m_SpanEndOffset )
270 ind = this->m_Image->ComputeIndex( static_cast< OffsetValueType >( this->m_Offset ) );
273 startIndex = this->m_Region.
GetIndex();
275 size = this->m_Region.GetSize();
283 done = ( --ind[0] == startIndex[0] - 1 );
284 for (
unsigned int i = 1; done && i < this->ImageIteratorDimension; i++ )
286 done = ( ind[i] == startIndex[i] );
294 while ( ( dim < this->ImageIteratorDimension - 1 )
295 && ( ind[dim] < startIndex[dim] ) )
297 ind[dim] = startIndex[dim] +
static_cast< OffsetValueType >( size[dim] ) - 1;
301 this->m_Offset = this->m_Image->ComputeOffset(ind);
302 m_SpanBeginOffset = this->m_Offset;
303 m_SpanEndOffset = m_SpanBeginOffset -
static_cast< OffsetValueType >( size[0] );
318 if ( ++this->m_Offset >= m_SpanBeginOffset )
328 ind = this->m_Image->ComputeIndex( static_cast< OffsetValueType >( this->m_Offset ) );
331 startIndex = this->m_Region.
GetIndex();
333 size = this->m_Region.GetSize();
341 done = ( ++ind[0] == startIndex[0] +
static_cast< OffsetValueType >( size[0] ) );
342 for (
unsigned int i = 1; done && i < this->ImageIteratorDimension; i++ )
344 done = ( ind[i] == startIndex[i] +
static_cast< OffsetValueType >( size[i] ) - 1 );
352 while ( ( dim < this->ImageIteratorDimension - 1 )
353 && ( ind[dim] > startIndex[dim] +
static_cast< OffsetValueType >( size[dim] ) - 1 ) )
355 ind[dim] = startIndex[dim];
359 this->m_Offset = this->m_Image->ComputeOffset(ind);
360 m_SpanBeginOffset = this->m_Offset;
361 m_SpanEndOffset = this->m_Offset -
static_cast< OffsetValueType >( size[0] );
372 #ifndef ITK_MANUAL_INSTANTIATION
373 #include "itkImageRegionReverseConstIterator.hxx"
TImage::PixelType PixelType
const IndexType GetIndex()
Superclass::SizeType SizeType
TImage::AccessorType AccessorType
TImage::PixelContainer PixelContainer
SizeValueType m_SpanEndOffset
signed long OffsetValueType
Superclass::ImageType ImageType
TImage::OffsetType OffsetType
ImageRegionReverseConstIterator(const ImageReverseConstIterator< TImage > &it)
Superclass::PixelType PixelType
A multi-dimensional image iterator designed to walk a specified image region in reverse.
unsigned long SizeValueType
PixelContainer::Pointer PixelContainerPointer
ImageRegionReverseConstIterator(const ImageConstIterator< TImage > &it)
A multi-dimensional image iterator templated over image type.
ImageRegionReverseConstIterator(const ImageRegionIterator< TImage > &it)
TImage::SizeType SizeType
TImage::IndexType IndexType
ImageRegionReverseConstIterator()
TImage::InternalPixelType InternalPixelType
Superclass::PixelContainer PixelContainer
Multi-dimensional image iterator.
Superclass::InternalPixelType InternalPixelType
TImage::IndexType IndexType
TImage::RegionType RegionType
Superclass::AccessorType AccessorType
SizeValueType m_SpanBeginOffset
Superclass::IndexType IndexType
ImageRegionReverseConstIterator(const ImageType *ptr, const RegionType ®ion)
Superclass::IndexType IndexType
Superclass::SizeType SizeType
ImageRegionReverseConstIterator Self
Superclass::RegionType RegionType
A multi-dimensional iterator templated over image type that walks a region of pixels.
TImage::SizeType SizeType
ImageReverseConstIterator< TImage > Superclass
Superclass::OffsetType OffsetType
void SetIndex(const IndexType &ind) override