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);
242 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
243 m_PixelAccessorFunctor.SetBegin(m_Buffer);
253 m_Buffer = m_Image->GetBufferPointer();
258 m_Offset = m_Image->ComputeOffset(ind);
261 m_EndOffset = m_Image->ComputeOffset( m_Region.GetIndex() ) - 1;
265 SizeType regSize( m_Region.GetSize() );
266 for (
unsigned int i = 0; i < TImage::ImageDimension; ++i )
268 regInd[i] += ( regSize[i] - 1 );
270 m_BeginOffset = m_Image->ComputeOffset(regInd);
272 m_PixelAccessor = m_Image->GetPixelAccessor();
273 m_PixelAccessorFunctor.SetPixelAccessor(m_PixelAccessor);
274 m_PixelAccessorFunctor.SetBegin(m_Buffer);
280 static unsigned int GetImageIteratorDimension()
281 {
return TImage::ImageDimension; }
295 operator==(
const Self & it)
const
306 {
return m_Image->ComputeIndex(m_Offset); }
311 { m_Offset = m_Image->ComputeOffset(ind); }
320 {
return m_PixelAccessorFunctor.Get( *( m_Buffer + m_Offset ) ); }
325 this->m_PixelAccessorFunctor.Set(*( const_cast< InternalPixelType * >(
326 this->m_Buffer + this->m_Offset ) ), value);
333 {
return *( m_Buffer + m_Offset ); }
339 {
return *( m_Buffer + m_Offset ); }
344 itkLegacyMacro(Self Begin()
const);
350 m_Offset = m_BeginOffset;
356 itkLegacyMacro(Self End()
const);
362 m_Offset = m_EndOffset;
369 return ( m_Offset == m_BeginOffset );
376 return ( m_Offset == m_EndOffset );
396 #define ITK_TEMPLATE_ImageReverseConstIterator(_, EXPORT, TypeX, TypeY) \
399 _( 1 ( class EXPORT ImageReverseConstIterator< ITK_TEMPLATE_1 TypeX > ) ) \
400 namespace Templates \
402 typedef ImageReverseConstIterator< ITK_TEMPLATE_1 TypeX > ImageReverseConstIterator##TypeY; \
406 #if ITK_TEMPLATE_EXPLICIT
407 #include "Templates/itkImageReverseConstIterator+-.h"
411 #include "itkImageReverseConstIterator.hxx"