18#ifndef itkImageConstIterator_h
19#define itkImageConstIterator_h
83template <
typename TImage>
94 static constexpr unsigned int ImageIteratorDimension = TImage::ImageDimension;
136 , m_PixelAccessorFunctor()
143 m_PixelAccessorFunctor.SetBegin(m_Buffer);
164 m_PixelAccessorFunctor.SetBegin(m_Buffer);
172 m_Buffer = m_Image->GetBufferPointer();
177 m_PixelAccessor = ptr->GetPixelAccessor();
178 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
179 m_PixelAccessorFunctor.SetBegin(m_Buffer);
199 m_PixelAccessorFunctor.SetBegin(m_Buffer);
210 if (region.GetNumberOfPixels() > 0)
212 const RegionType & bufferedRegion = m_Image->GetBufferedRegion();
213 itkAssertOrThrowMacro((bufferedRegion.IsInside(m_Region)),
214 "Region " << m_Region <<
" is outside of buffered region " << bufferedRegion);
218 m_Offset = m_Image->ComputeOffset(m_Region.GetIndex());
219 m_BeginOffset = m_Offset;
227 if (m_Region.GetNumberOfPixels() == 0)
230 m_EndOffset = m_BeginOffset;
234 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i)
238 m_EndOffset = m_Image->ComputeOffset(ind);
247 return TImage::ImageDimension;
316 m_Offset = m_Image->ComputeOffset(ind);
331 return m_Image.GetPointer();
338 return m_PixelAccessorFunctor.Get(*(m_Buffer + m_Offset));
347 return *(m_Buffer + m_Offset);
355 m_Offset = m_BeginOffset;
363 m_Offset = m_EndOffset;
371 return (m_Offset == m_BeginOffset);
379 return (m_Offset == m_EndOffset);
383 typename TImage::ConstWeakPointer m_Image{};
Pixel-wise addition of two images.
A multi-dimensional image iterator templated over image type.
typename TImage::IndexType IndexType
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self)
const RegionType & GetRegion() const
TImage::ConstWeakPointer m_Image
const PixelType & Value() const
virtual ~ImageConstIterator()=default
bool operator==(const Self &it) const
typename TImage::PixelContainer PixelContainer
bool operator>(const Self &it) const
virtual void SetIndex(const IndexType &ind)
typename TImage::SizeType SizeType
typename TImage::OffsetType OffsetType
const IndexType GetIndex() const
virtual void SetRegion(const RegionType ®ion)
typename TImage::InternalPixelType InternalPixelType
typename PixelContainer::Pointer PixelContainerPointer
OffsetValueType m_BeginOffset
const ImageType * GetImage() const
typename TImage::AccessorType AccessorType
typename TImage::AccessorFunctorType AccessorFunctorType
typename TImage::RegionType RegionType
OffsetValueType m_EndOffset
static unsigned int GetImageIteratorDimension()
AccessorFunctorType m_PixelAccessorFunctor
Self & operator=(const Self &it)
const InternalPixelType * m_Buffer
ImageConstIterator(const Self &it)
AccessorType m_PixelAccessor
ImageConstIterator(const ImageType *ptr, const RegionType ®ion)
typename TImage::PixelType PixelType
bool operator>=(const Self &it) 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....
bool operator<=(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)