ITK
6.0.0
Insight Toolkit
|
#include <itkConstSliceIterator.h>
A flexible iterator for ITK containers(i.e. itk::Neighborhood) that support pixel access through operator[].
ConstSliceIterator allows const 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[] const 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 51 of file itkConstSliceIterator.h.
Public Member Functions | |
ConstSliceIterator | Begin () |
ConstSliceIterator (const TContainer *n, std::slice s) | |
ConstSliceIterator | End () |
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION (ConstSliceIterator) | |
const TPixel & | operator* () |
ConstSliceIterator | operator++ () |
ConstSliceIterator | operator++ (int) |
bool | operator< (const ConstSliceIterator &orig) const |
bool | operator== (const ConstSliceIterator &orig) const |
const TPixel & | operator[] (SizeValueType n) |
Private Member Functions | |
const TPixel & | Loc (SizeValueType n) const |
Private Attributes | |
const TContainer * | m_ContainerPointer |
SizeValueType | m_Pos { 0 } |
std::slice | m_Slice |
|
inline |
Constructor.
Definition at line 56 of file itkConstSliceIterator.h.
|
inline |
Returns a ConstSliceIterator that points to the beginning of the slice.
Definition at line 63 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.
|
inline |
Returns a ConstSliceIterator that points to one past the end of the slice.
Definition at line 74 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos, and itk::ConstSliceIterator< TPixel, TContainer >::m_Slice.
itk::ConstSliceIterator< TPixel, TContainer >::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION | ( | ConstSliceIterator< TPixel, TContainer > | ) |
|
inlineprivate |
Returns the value located at position n of the slice.
Definition at line 140 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::m_ContainerPointer, and itk::ConstSliceIterator< TPixel, TContainer >::m_Slice.
Referenced by itk::ConstSliceIterator< TPixel, TContainer >::operator*(), and itk::ConstSliceIterator< TPixel, TContainer >::operator[]().
|
inline |
Dereferences the iterator, returning the value that it points to.
Definition at line 111 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::Loc(), and itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.
|
inline |
Increments the iterator.
Definition at line 84 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.
|
inline |
Increments the iterator.
Definition at line 92 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.
|
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 131 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos, and itk::ConstSliceIterator< TPixel, TContainer >::m_Slice.
|
inline |
Returns the logical && of the boolean == of two slice iterator positions, stride, and start locations.
Definition at line 119 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::m_Pos, and itk::ConstSliceIterator< TPixel, TContainer >::m_Slice.
|
inline |
Returns the element at position n of the slice. Sets the iterator to point to position n.
Definition at line 103 of file itkConstSliceIterator.h.
References itk::ConstSliceIterator< TPixel, TContainer >::Loc(), and itk::ConstSliceIterator< TPixel, TContainer >::m_Pos.
|
private |
Pointer to the container referenced by the slice iterator.
Definition at line 146 of file itkConstSliceIterator.h.
Referenced by itk::ConstSliceIterator< TPixel, TContainer >::Loc().
|
private |
Current position within the slice.
Definition at line 149 of file itkConstSliceIterator.h.
Referenced by itk::ConstSliceIterator< TPixel, TContainer >::Begin(), itk::ConstSliceIterator< TPixel, TContainer >::End(), itk::ConstSliceIterator< TPixel, TContainer >::operator*(), itk::ConstSliceIterator< TPixel, TContainer >::operator++(), itk::ConstSliceIterator< TPixel, TContainer >::operator<(), itk::ConstSliceIterator< TPixel, TContainer >::operator==(), and itk::ConstSliceIterator< TPixel, TContainer >::operator[]().
|
private |
Slice structure information.
Definition at line 152 of file itkConstSliceIterator.h.
Referenced by itk::ConstSliceIterator< TPixel, TContainer >::End(), itk::ConstSliceIterator< TPixel, TContainer >::Loc(), itk::ConstSliceIterator< TPixel, TContainer >::operator<(), and itk::ConstSliceIterator< TPixel, TContainer >::operator==().