18#ifndef itkImageReverseConstIterator_h
19#define itkImageReverseConstIterator_h
86template <
typename TImage>
97 static constexpr unsigned int ImageIteratorDimension = TImage::ImageDimension;
140 , m_PixelAccessorFunctor()
146 m_PixelAccessorFunctor.SetBegin(m_Buffer);
167 m_PixelAccessorFunctor.SetBegin(m_Buffer);
177 m_Buffer = m_Image->GetBufferPointer();
181 offset = m_Image->ComputeOffset(m_Region.GetIndex());
182 m_EndOffset = offset - 1;
187 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i)
189 ind[i] += (size[i] - 1);
191 m_BeginOffset = m_Image->ComputeOffset(ind);
192 m_Offset = m_BeginOffset;
194 m_PixelAccessor = ptr->GetPixelAccessor();
195 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
196 m_PixelAccessorFunctor.SetBegin(m_Buffer);
210 m_Buffer = m_Image->GetBufferPointer();
215 m_Offset = m_Image->ComputeOffset(ind);
218 m_EndOffset = m_Image->ComputeOffset(m_Region.GetIndex()) - 1;
222 SizeType regSize(m_Region.GetSize());
223 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i)
225 regInd[i] += (regSize[i] - 1);
227 m_BeginOffset = m_Image->ComputeOffset(regInd);
229 m_PixelAccessor = m_Image->GetPixelAccessor();
230 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
231 m_PixelAccessorFunctor.SetBegin(m_Buffer);
250 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
251 m_PixelAccessorFunctor.SetBegin(m_Buffer);
263 m_Buffer = m_Image->GetBufferPointer();
268 m_Offset = m_Image->ComputeOffset(ind);
271 m_EndOffset = m_Image->ComputeOffset(m_Region.GetIndex()) - 1;
275 SizeType regSize(m_Region.GetSize());
276 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i)
278 regInd[i] += (regSize[i] - 1);
280 m_BeginOffset = m_Image->ComputeOffset(regInd);
282 m_PixelAccessor = m_Image->GetPixelAccessor();
283 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
284 m_PixelAccessorFunctor.SetBegin(m_Buffer);
292 return TImage::ImageDimension;
314 return m_Image->ComputeIndex(m_Offset);
322 m_Offset = m_Image->ComputeOffset(ind);
337 return m_PixelAccessorFunctor.Get(*(m_Buffer + m_Offset));
344 this->m_PixelAccessorFunctor.Set(*(
const_cast<InternalPixelType *
>(this->m_Buffer + this->m_Offset)), value);
353 return *(m_Buffer + m_Offset);
362 return *(m_Buffer + m_Offset);
370 m_Offset = m_BeginOffset;
378 m_Offset = m_EndOffset;
386 return (m_Offset == m_BeginOffset);
394 return (m_Offset == m_EndOffset);
398 typename ImageType::ConstWeakPointer m_Image{};
Pixel-wise addition of two images.
A multi-dimensional image iterator templated over image type.
const RegionType & GetRegion() const
const IndexType GetIndex() const
const ImageType * GetImage() const
Multi-dimensional image iterator.
virtual void SetIndex(const IndexType &ind)
const PixelType & Value() const
const PixelType Get() const
ImageReverseConstIterator(const Self &it)
typename TImage::PixelType PixelType
ImageReverseConstIterator()
static unsigned int GetImageIteratorDimension()
ImageReverseConstIterator(const ImageConstIterator< TImage > &it)
typename TImage::RegionType RegionType
AccessorFunctorType m_PixelAccessorFunctor
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self)
typename TImage::AccessorFunctorType AccessorFunctorType
typename TImage::SizeType SizeType
typename TImage::OffsetType OffsetType
ImageType::ConstWeakPointer m_Image
typename TImage::IndexType IndexType
Self & operator=(const Self &it)
Self & operator=(const ImageConstIterator< TImage > &it)
SizeValueType m_BeginOffset
virtual ~ImageReverseConstIterator()=default
typename TImage::AccessorType AccessorType
const IndexType GetIndex()
const InternalPixelType * m_Buffer
const RegionType & GetRegion() const
const PixelType & Value()
typename PixelContainer::Pointer PixelContainerPointer
typename TImage::PixelContainer PixelContainer
AccessorType m_PixelAccessor
typename TImage::InternalPixelType InternalPixelType
bool operator==(const Self &it) const
ImageReverseConstIterator(const ImageType *ptr, const RegionType ®ion)
SizeValueType m_EndOffset
void Set(const PixelType &value) const
SmartPointer< Self > Pointer
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType