ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::SliceIterator< TPixel, TContainer > Class Template Reference

#include <itkSliceIterator.h>

Detailed Description

template<typename TPixel, typename 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 [111].

Definition at line 47 of file itkSliceIterator.h.

Public Member Functions

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

Private Member Functions

TPixel & Loc (OffsetValueType n) const
 

Private Attributes

TContainer * m_ContainerPointer
 
OffsetValueType m_Pos { 0 }
 
std::slice m_Slice
 

Constructor & Destructor Documentation

◆ SliceIterator()

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

Constructor.

Definition at line 51 of file itkSliceIterator.h.

Member Function Documentation

◆ Begin()

template<typename TPixel, typename TContainer>
SliceIterator itk::SliceIterator< TPixel, TContainer >::Begin ( )
inline

Returns a SliceIterator that points to the beginning of the slice.

Definition at line 58 of file itkSliceIterator.h.

◆ End()

template<typename TPixel, typename TContainer>
SliceIterator itk::SliceIterator< TPixel, TContainer >::End ( )
inline

Returns a SliceIterator that points to one past the end of the slice.

Definition at line 68 of file itkSliceIterator.h.

◆ ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION()

template<typename TPixel, typename TContainer>
itk::SliceIterator< TPixel, TContainer >::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION ( SliceIterator< TPixel, TContainer > )

◆ Loc()

template<typename TPixel, typename TContainer>
TPixel & itk::SliceIterator< TPixel, TContainer >::Loc ( OffsetValueType n) const
inlineprivate

Returns the value located at position n of the slice.

Definition at line 134 of file itkSliceIterator.h.

Referenced by itk::SliceIterator< TPixel, Self >::operator*(), and itk::SliceIterator< TPixel, Self >::operator[]().

◆ operator*()

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

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

Definition at line 105 of file itkSliceIterator.h.

◆ operator++() [1/2]

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

Increments the iterator.

Definition at line 78 of file itkSliceIterator.h.

◆ operator++() [2/2]

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

Increments the iterator.

Definition at line 86 of file itkSliceIterator.h.

◆ operator<()

template<typename TPixel, typename TContainer>
bool itk::SliceIterator< TPixel, TContainer >::operator< ( const SliceIterator< TPixel, TContainer > & orig) const
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 124 of file itkSliceIterator.h.

◆ operator==()

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

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

Definition at line 113 of file itkSliceIterator.h.

◆ operator[]()

template<typename TPixel, typename TContainer>
TPixel & itk::SliceIterator< TPixel, TContainer >::operator[] ( OffsetValueType n)
inline

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

Definition at line 97 of file itkSliceIterator.h.

Member Data Documentation

◆ m_ContainerPointer

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

Pointer to the container referenced by the slice iterator.

Definition at line 144 of file itkSliceIterator.h.

◆ m_Pos

template<typename TPixel, typename TContainer>
OffsetValueType itk::SliceIterator< TPixel, TContainer >::m_Pos { 0 }
private

◆ m_Slice

template<typename TPixel, typename TContainer>
std::slice itk::SliceIterator< TPixel, TContainer >::m_Slice
private

Slice structure information.

Definition at line 150 of file itkSliceIterator.h.

Referenced by itk::SliceIterator< TPixel, Self >::operator<(), and itk::SliceIterator< TPixel, Self >::operator==().


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