18 #ifndef __itkImageReverseConstIterator_h
19 #define __itkImageReverseConstIterator_h
86 template<
typename TImage >
97 itkStaticConstMacro(ImageIteratorDimension,
unsigned int,
98 TImage::ImageDimension);
142 m_PixelAccessorFunctor.SetBegin(m_Buffer);
163 m_PixelAccessorFunctor.SetBegin(m_Buffer);
173 m_Buffer = m_Image->GetBufferPointer();
177 offset = m_Image->ComputeOffset( m_Region.GetIndex() );
178 m_EndOffset = offset - 1;
182 SizeType size( m_Region.GetSize() );
183 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
185 ind[i] += ( size[i] - 1 );
187 m_BeginOffset = m_Image->ComputeOffset(ind);
188 m_Offset = m_BeginOffset;
190 m_PixelAccessor = ptr->GetPixelAccessor();
191 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
192 m_PixelAccessorFunctor.SetBegin(m_Buffer);
206 m_Buffer = m_Image->GetBufferPointer();
211 m_Offset = m_Image->ComputeOffset(ind);
214 m_EndOffset = m_Image->ComputeOffset( m_Region.GetIndex() ) - 1;
218 SizeType regSize( m_Region.GetSize() );
219 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
221 regInd[i] += ( regSize[i] - 1 );
223 m_BeginOffset = m_Image->ComputeOffset(regInd);
225 m_PixelAccessor = m_Image->GetPixelAccessor();
226 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
227 m_PixelAccessorFunctor.SetBegin(m_Buffer);
245 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
246 m_PixelAccessorFunctor.SetBegin(m_Buffer);
257 m_Buffer = m_Image->GetBufferPointer();
262 m_Offset = m_Image->ComputeOffset(ind);
265 m_EndOffset = m_Image->ComputeOffset( m_Region.GetIndex() ) - 1;
269 SizeType regSize( m_Region.GetSize() );
270 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
272 regInd[i] += ( regSize[i] - 1 );
274 m_BeginOffset = m_Image->ComputeOffset(regInd);
276 m_PixelAccessor = m_Image->GetPixelAccessor();
277 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
278 m_PixelAccessorFunctor.SetBegin(m_Buffer);
283 static unsigned int GetImageIteratorDimension()
284 {
return TImage::ImageDimension; }
298 operator==(
const Self & it)
const
309 {
return m_Image->ComputeIndex(m_Offset); }
314 { m_Offset = m_Image->ComputeOffset(ind); }
323 {
return m_PixelAccessorFunctor.Get( *( m_Buffer + m_Offset ) ); }
328 this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >(
329 this->m_Buffer + this->m_Offset ) ), value);
336 {
return *( m_Buffer + m_Offset ); }
342 {
return *( m_Buffer + m_Offset ); }
347 itkLegacyMacro(Self Begin()
const);
353 m_Offset = m_BeginOffset;
359 itkLegacyMacro(Self End()
const);
365 m_Offset = m_EndOffset;
372 return ( m_Offset == m_BeginOffset );
379 return ( m_Offset == m_EndOffset );
398 #ifndef ITK_MANUAL_INSTANTIATION
399 #include "itkImageReverseConstIterator.hxx"