18 #ifndef itkImageReverseConstIterator_h
19 #define itkImageReverseConstIterator_h
86 template<
typename TImage >
97 static constexpr
unsigned int ImageIteratorDimension = TImage::ImageDimension;
144 m_PixelAccessorFunctor.SetBegin(m_Buffer);
165 m_PixelAccessorFunctor.SetBegin(m_Buffer);
175 m_Buffer = m_Image->GetBufferPointer();
179 offset = m_Image->ComputeOffset( m_Region.GetIndex() );
180 m_EndOffset = offset - 1;
184 SizeType size( m_Region.GetSize() );
185 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
187 ind[i] += ( size[i] - 1 );
189 m_BeginOffset = m_Image->ComputeOffset(ind);
190 m_Offset = m_BeginOffset;
192 m_PixelAccessor = ptr->GetPixelAccessor();
193 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
194 m_PixelAccessorFunctor.SetBegin(m_Buffer);
208 m_Buffer = m_Image->GetBufferPointer();
213 m_Offset = m_Image->ComputeOffset(ind);
216 m_EndOffset = m_Image->ComputeOffset( m_Region.GetIndex() ) - 1;
220 SizeType regSize( m_Region.GetSize() );
221 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
223 regInd[i] += ( regSize[i] - 1 );
225 m_BeginOffset = m_Image->ComputeOffset(regInd);
227 m_PixelAccessor = m_Image->GetPixelAccessor();
228 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
229 m_PixelAccessorFunctor.SetBegin(m_Buffer);
247 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
248 m_PixelAccessorFunctor.SetBegin(m_Buffer);
259 m_Buffer = m_Image->GetBufferPointer();
264 m_Offset = m_Image->ComputeOffset(ind);
267 m_EndOffset = m_Image->ComputeOffset( m_Region.GetIndex() ) - 1;
271 SizeType regSize( m_Region.GetSize() );
272 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
274 regInd[i] += ( regSize[i] - 1 );
276 m_BeginOffset = m_Image->ComputeOffset(regInd);
278 m_PixelAccessor = m_Image->GetPixelAccessor();
279 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
280 m_PixelAccessorFunctor.SetBegin(m_Buffer);
286 {
return TImage::ImageDimension; }
311 {
return m_Image->ComputeIndex(m_Offset); }
316 { m_Offset = m_Image->ComputeOffset(ind); }
325 {
return m_PixelAccessorFunctor.Get( *( m_Buffer + m_Offset ) ); }
330 this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >(
331 this->m_Buffer + this->m_Offset ) ), value);
338 {
return *( m_Buffer + m_Offset ); }
344 {
return *( m_Buffer + m_Offset ); }
350 m_Offset = m_BeginOffset;
357 m_Offset = m_EndOffset;
364 return ( m_Offset == m_BeginOffset );
371 return ( m_Offset == m_EndOffset );
const RegionType & GetRegion() const
const RegionType & GetRegion() const
const PixelType Get() const
const IndexType GetIndex()
Self & operator=(const ImageConstIterator< TImage > &it)
unsigned long SizeValueType
const IndexType GetIndex() const
AccessorFunctorType m_PixelAccessorFunctor
const InternalPixelType * m_Buffer
typename TImage::SizeType SizeType
typename TImage::PixelContainer PixelContainer
const PixelType & Value()
typename TImage::AccessorType AccessorType
ImageReverseConstIterator(const ImageType *ptr, const RegionType ®ion)
A multi-dimensional image iterator templated over image type.
typename TImage::InternalPixelType InternalPixelType
bool operator!=(const Self &it) const
Self & operator=(const Self &it)
ImageType::ConstWeakPointer m_Image
ImageReverseConstIterator()
AccessorType m_PixelAccessor
ImageBaseType::SizeType SizeType
typename TImage::PixelType PixelType
const PixelType & Value() const
ImageReverseConstIterator(const ImageConstIterator< TImage > &it)
ImageBaseType::IndexType IndexType
static unsigned int GetImageIteratorDimension()
typename TImage::IndexType IndexType
Multi-dimensional image iterator.
virtual void SetIndex(const IndexType &ind)
SizeValueType m_EndOffset
void Set(const PixelType &value) const
typename PixelContainer::Pointer PixelContainerPointer
typename TImage::OffsetType OffsetType
typename TImage::RegionType RegionType
SizeValueType m_BeginOffset
ImageReverseConstIterator(const Self &it)
typename TImage::AccessorFunctorType AccessorFunctorType
ImageBaseType::RegionType RegionType
bool operator==(const Self &it) const
const ImageType * GetImage() const