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;
320 return m_Image->ComputeIndex(m_Offset);
328 m_Offset = m_Image->ComputeOffset(ind);
343 return m_PixelAccessorFunctor.Get(*(m_Buffer + m_Offset));
350 this->m_PixelAccessorFunctor.Set(*(const_cast<InternalPixelType *>(this->m_Buffer + this->m_Offset)), value);
359 return *(m_Buffer + m_Offset);
368 return *(m_Buffer + m_Offset);
376 m_Offset = m_BeginOffset;
384 m_Offset = m_EndOffset;
392 return (m_Offset == m_BeginOffset);
400 return (m_Offset == m_EndOffset);