Orfeo Toolbox  3.16
Public Member Functions | Private Member Functions | Private Attributes | List of all members
itk::SliceIterator< TPixel, TContainer > Class Template Reference

A flexible iterator for itk containers(i.e. itk::Neighborhood) that support pixel access through operator[]. More...

#include <itkSliceIterator.h>

Public Member Functions

 SliceIterator (TContainer *n, std::slice s)
 
SliceIterator Begin ()
 
SliceIterator End ()
 
bool operator!= (const SliceIterator &orig)
 
TPixel & operator* ()
 
SliceIterator operator++ ()
 
SliceIterator operator++ (int)
 
bool operator< (const SliceIterator &orig)
 
bool operator== (const SliceIterator &orig)
 
TPixel & operator[] (unsigned long n)
 

Private Member Functions

TPixel & Loc (unsigned long n) const
 

Private Attributes

TContainer * m_ContainerPointer
 
unsigned long m_Pos
 
std::slice m_Slice
 

Detailed Description

template<class TPixel, class TContainer>
class itk::SliceIterator< TPixel, TContainer >

A flexible iterator for itk containers(i.e. itk::Neighborhood) that support pixel access through operator[].

SliceIterator allows iteration along a std::slice through the container. A slice is a construct that defines a starting position, stride length (distance between adjacent elements), and a length.

Any container with operator[] is supported. Because it uses this interface the iterator is only as efficient as the implementation of a container's operator[] method.

References: Modeled after a slice iterator proposed by Bjarne Stroustrup in C++ Programming Language, Third Edition. Bjarne Stroustrup. Addison Wesley, Reading, MA. 1997.

Definition at line 45 of file itkSliceIterator.h.

Constructor & Destructor Documentation

template<class TPixel , class TContainer >
itk::SliceIterator< TPixel, TContainer >::SliceIterator ( TContainer *  n,
std::slice  s 
)
inline

Constructor.

Definition at line 49 of file itkSliceIterator.h.

Member Function Documentation

template<class TPixel , class TContainer >
SliceIterator itk::SliceIterator< TPixel, TContainer >::Begin ( void  )
inline
template<class TPixel , class TContainer >
SliceIterator itk::SliceIterator< TPixel, TContainer >::End ( void  )
inline
template<class TPixel , class TContainer >
TPixel& itk::SliceIterator< TPixel, TContainer >::Loc ( unsigned long  n) const
inlineprivate

Returns the value located at position n of the slice.

Definition at line 120 of file itkSliceIterator.h.

template<class TPixel , class TContainer >
bool itk::SliceIterator< TPixel, TContainer >::operator!= ( const SliceIterator< TPixel, TContainer > &  orig)
inline

Returns the logical inverse of the boolean == of two slice iterators.

Definition at line 103 of file itkSliceIterator.h.

References itk::operator==().

template<class TPixel , class TContainer >
TPixel& itk::SliceIterator< TPixel, TContainer >::operator* ( )
inline

Dereferences the iterator, returning the value that it points to.

Definition at line 90 of file itkSliceIterator.h.

template<class TPixel , class TContainer >
SliceIterator itk::SliceIterator< TPixel, TContainer >::operator++ ( )
inline

Increments the iterator.

Definition at line 69 of file itkSliceIterator.h.

template<class TPixel , class TContainer >
SliceIterator itk::SliceIterator< TPixel, TContainer >::operator++ ( int  )
inline

Increments the iterator.

Definition at line 76 of file itkSliceIterator.h.

template<class TPixel , class TContainer >
bool itk::SliceIterator< TPixel, TContainer >::operator< ( const SliceIterator< TPixel, TContainer > &  orig)
inline

Returns the boolean < of two slice iterator positions. Result is only true if the slice iterators have the same stride and start location.

Definition at line 111 of file itkSliceIterator.h.

References itk::SliceIterator< TPixel, TContainer >::m_Pos, and itk::SliceIterator< TPixel, TContainer >::m_Slice.

template<class TPixel , class TContainer >
bool itk::SliceIterator< TPixel, TContainer >::operator== ( const SliceIterator< TPixel, TContainer > &  orig)
inline

Returns the logical && of the boolean == of two slice iterator positions, stride, and start locations.

Definition at line 95 of file itkSliceIterator.h.

References itk::SliceIterator< TPixel, TContainer >::m_Pos, and itk::SliceIterator< TPixel, TContainer >::m_Slice.

template<class TPixel , class TContainer >
TPixel& itk::SliceIterator< TPixel, TContainer >::operator[] ( unsigned long  n)
inline

Returns the element at position n of the slice. Sets the iterator to point to position n.

Definition at line 85 of file itkSliceIterator.h.

Member Data Documentation

template<class TPixel , class TContainer >
TContainer* itk::SliceIterator< TPixel, TContainer >::m_ContainerPointer
private

Pointer to the container referenced by the slice iterator.

Definition at line 128 of file itkSliceIterator.h.

template<class TPixel , class TContainer >
unsigned long itk::SliceIterator< TPixel, TContainer >::m_Pos
private
template<class TPixel , class TContainer >
std::slice itk::SliceIterator< TPixel, TContainer >::m_Slice
private

The documentation for this class was generated from the following file:

Generated at Sun May 19 2013 02:37:07 for Orfeo Toolbox with doxygen 1.8.3.1