18 #ifndef itkImageReverseConstIterator_h
19 #define itkImageReverseConstIterator_h
86 template<
typename TImage >
97 itkStaticConstMacro(ImageIteratorDimension,
unsigned int,
98 TImage::ImageDimension);
145 m_PixelAccessorFunctor.SetBegin(m_Buffer);
166 m_PixelAccessorFunctor.SetBegin(m_Buffer);
176 m_Buffer = m_Image->GetBufferPointer();
180 offset = m_Image->ComputeOffset( m_Region.GetIndex() );
181 m_EndOffset = offset - 1;
185 SizeType size( m_Region.GetSize() );
186 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
188 ind[i] += ( size[i] - 1 );
190 m_BeginOffset = m_Image->ComputeOffset(ind);
191 m_Offset = m_BeginOffset;
193 m_PixelAccessor = ptr->GetPixelAccessor();
194 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
195 m_PixelAccessorFunctor.SetBegin(m_Buffer);
209 m_Buffer = m_Image->GetBufferPointer();
214 m_Offset = m_Image->ComputeOffset(ind);
217 m_EndOffset = m_Image->ComputeOffset( m_Region.GetIndex() ) - 1;
221 SizeType regSize( m_Region.GetSize() );
222 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
224 regInd[i] += ( regSize[i] - 1 );
226 m_BeginOffset = m_Image->ComputeOffset(regInd);
228 m_PixelAccessor = m_Image->GetPixelAccessor();
229 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
230 m_PixelAccessorFunctor.SetBegin(m_Buffer);
248 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
249 m_PixelAccessorFunctor.SetBegin(m_Buffer);
260 m_Buffer = m_Image->GetBufferPointer();
265 m_Offset = m_Image->ComputeOffset(ind);
268 m_EndOffset = m_Image->ComputeOffset( m_Region.GetIndex() ) - 1;
272 SizeType regSize( m_Region.GetSize() );
273 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
275 regInd[i] += ( regSize[i] - 1 );
277 m_BeginOffset = m_Image->ComputeOffset(regInd);
279 m_PixelAccessor = m_Image->GetPixelAccessor();
280 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
281 m_PixelAccessorFunctor.SetBegin(m_Buffer);
287 {
return TImage::ImageDimension; }
312 {
return m_Image->ComputeIndex(m_Offset); }
317 { m_Offset = m_Image->ComputeOffset(ind); }
326 {
return m_PixelAccessorFunctor.Get( *( m_Buffer + m_Offset ) ); }
331 this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >(
332 this->m_Buffer + this->m_Offset ) ), value);
339 {
return *( m_Buffer + m_Offset ); }
345 {
return *( m_Buffer + m_Offset ); }
350 itkLegacyMacro(Self Begin()
const);
356 m_Offset = m_BeginOffset;
362 itkLegacyMacro(Self End()
const);
368 m_Offset = m_EndOffset;
375 return ( m_Offset == m_BeginOffset );
382 return ( m_Offset == m_EndOffset );
401 #ifndef ITK_MANUAL_INSTANTIATION
402 #include "itkImageReverseConstIterator.hxx"
TImage::PixelType PixelType
const RegionType & GetRegion() const
const RegionType & GetRegion() const
const IndexType GetIndex()
Self & operator=(const ImageConstIterator< TImage > &it)
TImage::AccessorType AccessorType
TImage::PixelContainer PixelContainer
TImage::OffsetType OffsetType
const IndexType GetIndex() const
AccessorFunctorType m_PixelAccessorFunctor
const InternalPixelType * m_Buffer
virtual ~ImageReverseConstIterator()
unsigned long SizeValueType
ImageReverseConstIterator(const ImageType *ptr, const RegionType ®ion)
A multi-dimensional image iterator templated over image type.
TImage::SizeType SizeType
TImage::IndexType IndexType
bool operator!=(const Self &it) const
Self & operator=(const Self &it)
ImageType::ConstWeakPointer m_Image
const PixelType Get(void) const
ImageReverseConstIterator()
AccessorType m_PixelAccessor
ImageReverseConstIterator(const ImageConstIterator< TImage > &it)
TImage::InternalPixelType InternalPixelType
static unsigned int GetImageIteratorDimension()
const PixelType & Value(void)
Multi-dimensional image iterator.
virtual void SetIndex(const IndexType &ind)
SizeValueType m_EndOffset
void Set(const PixelType &value) const
TImage::RegionType RegionType
SizeValueType m_BeginOffset
const PixelType & Value(void) const
ImageBaseType::SizeType SizeType
ImageReverseConstIterator(const Self &it)
PixelContainer::Pointer PixelContainerPointer
TImage::AccessorFunctorType AccessorFunctorType
bool operator==(const Self &it) const
ImageReverseConstIterator Self
const ImageType * GetImage() const
ImageBaseType::IndexType IndexType