18 #ifndef itkImageReverseConstIterator_h
19 #define itkImageReverseConstIterator_h
86 template <
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;
304 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(
Self);
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{};