ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
itk::ImageConstIteratorWithOnlyIndex< TImage > Class Template Reference

#include <itkImageConstIteratorWithOnlyIndex.h>

Detailed Description

template<typename TImage>
class itk::ImageConstIteratorWithOnlyIndex< TImage >

A base class for multi-dimensional iterators templated over image type that are designed to provide only index information, and no pixel access.

ImageConstIteratorWithOnlyIndex is a templated class to represent a multi-dimensional iterator, and is templated over the dimension of the image.

The "WithOnlyIndex" family of iterators differs from the "WithIndex" family of iterators in that only index information is available. The iterator does not access image data at all, and thus can be safely used with images of type ImageBase.

ImageConstIteratorWithOnlyIndex is a base class for the "WithOnlyIndex" family of ITK image iterators, which are designed to efficiently keep track of the image index position of the iterator during increment and decrement operations. This iterator is a base class and provides only the basic construction and comparison operations. It does not provide mechanisms for moving the iterator. A subclass of ImageConstIteratorWithOnlyIndex must be used to move the iterator.

ImageConstIteratorWithOnlyIndex is a multi-dimensional iterator, requiring more information be specified before the iterator can be used than conventional iterators. Whereas the std::vector::iterator from the STL only needs to be passed a pointer to establish the iterator, the multi-dimensional image iterator needs a pointer, the size of the region, and the start index of the region. To gain access to this information, ImageConstIteratorWithOnlyIndex holds a reference to the image over which it is traversing.

MORE INFORMATION
For a complete description of the ITK Image Iterators and their API, please see the Iterators chapter in the ITK Software Guide. The ITK Software Guide is available in print and as a free .pdf download from https://www.itk.org.
See also
ImageRegionConstIteratorWithOnlyIndex
ImageRandomConstIteratorWithOnlyIndex
ConstNeighborhoodIteratorWithOnlyIndex
ImageConstIterator
ConditionalConstIterator
ConstNeighborhoodIterator
ConstShapedNeighborhoodIterator
ConstSliceIterator
CorrespondenceDataStructureIterator
FloodFilledFunctionConditionalConstIterator
FloodFilledImageFunctionConditionalConstIterator
FloodFilledImageFunctionConditionalIterator
FloodFilledSpatialFunctionConditionalConstIterator
FloodFilledSpatialFunctionConditionalIterator
ImageConstIterator
ImageConstIteratorWithIndex
ImageIterator
ImageIteratorWithIndex
ImageLinearConstIteratorWithIndex
ImageLinearIteratorWithIndex
ImageRandomConstIteratorWithIndex
ImageRandomIteratorWithIndex
ImageRegionConstIterator
ImageRegionConstIteratorWithIndex
ImageRegionExclusionConstIteratorWithIndex
ImageRegionExclusionIteratorWithIndex
ImageRegionIterator
ImageRegionIteratorWithIndex
ImageRegionReverseConstIterator
ImageRegionReverseIterator
ImageReverseConstIterator
ImageReverseIterator
ImageSliceConstIteratorWithIndex
ImageSliceIteratorWithIndex
NeighborhoodIterator
PathConstIterator
PathIterator
ShapedNeighborhoodIterator
SliceIterator

Definition at line 95 of file itkImageConstIteratorWithOnlyIndex.h.

+ Inheritance diagram for itk::ImageConstIteratorWithOnlyIndex< TImage >:

Public Types

using ImageType = TImage
 
using IndexType = typename TImage::IndexType
 
using IndexValueType = typename IndexType::IndexValueType
 
using OffsetType = typename TImage::OffsetType
 
using OffsetValueType = typename OffsetType::OffsetValueType
 
using RegionType = typename TImage::RegionType
 
using Self = ImageConstIteratorWithOnlyIndex
 
using SizeType = typename TImage::SizeType
 
using SizeValueType = typename SizeType::SizeValueType
 

Public Member Functions

const IndexTypeGetIndex () const
 
const RegionTypeGetRegion () const
 
void GoToBegin ()
 
void GoToReverseBegin ()
 
 ImageConstIteratorWithOnlyIndex ()=default
 
 ImageConstIteratorWithOnlyIndex (const TImage *ptr, const RegionType &region)
 
bool IsAtEnd () const
 
bool IsAtReverseEnd () const
 
 ITK_DEFAULT_COPY_AND_MOVE (ImageConstIteratorWithOnlyIndex)
 
 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION (Self)
 
bool operator< (const Self &it) const
 
bool operator<= (const Self &it) const
 
bool operator== (const Self &it) const
 
bool operator> (const Self &it) const
 
bool operator>= (const Self &it) const
 
bool Remaining ()
 
void SetIndex (const IndexType &ind)
 
virtual ~ImageConstIteratorWithOnlyIndex ()=default
 

Static Public Member Functions

static constexpr unsigned int GetImageDimension ()
 

Static Public Attributes

static constexpr unsigned int ImageDimension = TImage::ImageDimension
 

Protected Attributes

IndexType m_BeginIndex { { 0 } }
 
IndexType m_EndIndex { { 0 } }
 
TImage::ConstPointer m_Image {}
 
OffsetValueType m_OffsetTable [ImageDimension+1] {}
 
IndexType m_PositionIndex { { 0 } }
 
RegionType m_Region {}
 
bool m_Remaining { false }
 

Member Typedef Documentation

◆ ImageType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::ImageType = TImage

Image type alias support

Definition at line 121 of file itkImageConstIteratorWithOnlyIndex.h.

◆ IndexType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::IndexType = typename TImage::IndexType

Index type alias support

Definition at line 110 of file itkImageConstIteratorWithOnlyIndex.h.

◆ IndexValueType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::IndexValueType = typename IndexType::IndexValueType

Definition at line 111 of file itkImageConstIteratorWithOnlyIndex.h.

◆ OffsetType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::OffsetType = typename TImage::OffsetType

Type of the Offset taken from the image

Definition at line 124 of file itkImageConstIteratorWithOnlyIndex.h.

◆ OffsetValueType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::OffsetValueType = typename OffsetType::OffsetValueType

Definition at line 125 of file itkImageConstIteratorWithOnlyIndex.h.

◆ RegionType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::RegionType = typename TImage::RegionType

Region type alias support

Definition at line 118 of file itkImageConstIteratorWithOnlyIndex.h.

◆ Self

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::Self = ImageConstIteratorWithOnlyIndex

Standard class type aliases.

Definition at line 101 of file itkImageConstIteratorWithOnlyIndex.h.

◆ SizeType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::SizeType = typename TImage::SizeType

Size type alias support

Definition at line 114 of file itkImageConstIteratorWithOnlyIndex.h.

◆ SizeValueType

template<typename TImage>
using itk::ImageConstIteratorWithOnlyIndex< TImage >::SizeValueType = typename SizeType::SizeValueType

Definition at line 115 of file itkImageConstIteratorWithOnlyIndex.h.

Constructor & Destructor Documentation

◆ ImageConstIteratorWithOnlyIndex() [1/2]

template<typename TImage>
itk::ImageConstIteratorWithOnlyIndex< TImage >::ImageConstIteratorWithOnlyIndex ( )
default

Default Constructor. Need to provide a default constructor since we provide a copy constructor.

◆ ImageConstIteratorWithOnlyIndex() [2/2]

template<typename TImage>
itk::ImageConstIteratorWithOnlyIndex< TImage >::ImageConstIteratorWithOnlyIndex ( const TImage *  ptr,
const RegionType region 
)

Constructor establishes an iterator to walk a particular image and a particular region of that image. Initializes the iterator at the begin of the region.

◆ ~ImageConstIteratorWithOnlyIndex()

template<typename TImage>
virtual itk::ImageConstIteratorWithOnlyIndex< TImage >::~ImageConstIteratorWithOnlyIndex ( )
virtualdefault

Default Destructor.

Member Function Documentation

◆ GetImageDimension()

template<typename TImage>
static constexpr unsigned int itk::ImageConstIteratorWithOnlyIndex< TImage >::GetImageDimension ( )
inlinestaticconstexpr

Get the dimension (size) of the index.

Definition at line 140 of file itkImageConstIteratorWithOnlyIndex.h.

◆ GetIndex()

template<typename TImage>
const IndexType& itk::ImageConstIteratorWithOnlyIndex< TImage >::GetIndex ( ) const
inline

Get the index. This provides a read only reference to the index.

See also
SetIndex

Definition at line 199 of file itkImageConstIteratorWithOnlyIndex.h.

◆ GetRegion()

template<typename TImage>
const RegionType& itk::ImageConstIteratorWithOnlyIndex< TImage >::GetRegion ( ) const
inline

Get the region that this iterator walks. ImageIterators know the beginning and the end of the region of the image to iterate over.

Definition at line 207 of file itkImageConstIteratorWithOnlyIndex.h.

◆ GoToBegin()

template<typename TImage>
void itk::ImageConstIteratorWithOnlyIndex< TImage >::GoToBegin ( )

Move an iterator to the beginning of the region.

◆ GoToReverseBegin()

template<typename TImage>
void itk::ImageConstIteratorWithOnlyIndex< TImage >::GoToReverseBegin ( )

Move an iterator to the End of the region.

◆ IsAtEnd()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::IsAtEnd ( ) const
inline

Is the iterator at the end of the region?

Definition at line 237 of file itkImageConstIteratorWithOnlyIndex.h.

◆ IsAtReverseEnd()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::IsAtReverseEnd ( ) const
inline

Is the iterator at the beginning of the region?

Definition at line 230 of file itkImageConstIteratorWithOnlyIndex.h.

◆ ITK_DEFAULT_COPY_AND_MOVE()

template<typename TImage>
itk::ImageConstIteratorWithOnlyIndex< TImage >::ITK_DEFAULT_COPY_AND_MOVE ( ImageConstIteratorWithOnlyIndex< TImage >  )

◆ ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION()

template<typename TImage>
itk::ImageConstIteratorWithOnlyIndex< TImage >::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION ( Self  )

◆ operator<()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::operator< ( const Self it) const
inline

Comparison operator. An iterator is "less than" another if it "points to" a lower memory location.

Definition at line 169 of file itkImageConstIteratorWithOnlyIndex.h.

References itk::ImageConstIteratorWithOnlyIndex< TImage >::m_PositionIndex.

◆ operator<=()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::operator<= ( const Self it) const
inline

Comparison operator. An iterator is "less than" another if it "points to" a lower memory location.

Definition at line 159 of file itkImageConstIteratorWithOnlyIndex.h.

References itk::ImageConstIteratorWithOnlyIndex< TImage >::m_PositionIndex.

◆ operator==()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::operator== ( const Self it) const
inline

Comparison operator. Two iterators are the same if they "point to" the same memory location

Definition at line 148 of file itkImageConstIteratorWithOnlyIndex.h.

References itk::ImageConstIteratorWithOnlyIndex< TImage >::m_PositionIndex.

◆ operator>()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::operator> ( const Self it) const
inline

Comparison operator. An iterator is "greater than" another if it "points to" a higher location.

Definition at line 189 of file itkImageConstIteratorWithOnlyIndex.h.

References itk::ImageConstIteratorWithOnlyIndex< TImage >::m_PositionIndex.

◆ operator>=()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::operator>= ( const Self it) const
inline

Comparison operator. An iterator is "greater than" another if it "points to" a higher location.

Definition at line 179 of file itkImageConstIteratorWithOnlyIndex.h.

References itk::ImageConstIteratorWithOnlyIndex< TImage >::m_PositionIndex.

◆ Remaining()

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::Remaining ( )
inline

Are there data remaining in the region ?

Definition at line 244 of file itkImageConstIteratorWithOnlyIndex.h.

◆ SetIndex()

template<typename TImage>
void itk::ImageConstIteratorWithOnlyIndex< TImage >::SetIndex ( const IndexType ind)
inline

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 215 of file itkImageConstIteratorWithOnlyIndex.h.

Member Data Documentation

◆ ImageDimension

template<typename TImage>
constexpr unsigned int itk::ImageConstIteratorWithOnlyIndex< TImage >::ImageDimension = TImage::ImageDimension
staticconstexpr

Dimension of the image that the iterator walks. This constant is needed so functions that are templated over image iterator type (as opposed to being templated over pixel type and dimension) can have compile time access to the dimension of the image that the iterator walks.

Definition at line 107 of file itkImageConstIteratorWithOnlyIndex.h.

◆ m_BeginIndex

template<typename TImage>
IndexType itk::ImageConstIteratorWithOnlyIndex< TImage >::m_BeginIndex { { 0 } }
protected

Definition at line 253 of file itkImageConstIteratorWithOnlyIndex.h.

◆ m_EndIndex

template<typename TImage>
IndexType itk::ImageConstIteratorWithOnlyIndex< TImage >::m_EndIndex { { 0 } }
protected

Definition at line 254 of file itkImageConstIteratorWithOnlyIndex.h.

◆ m_Image

template<typename TImage>
TImage::ConstPointer itk::ImageConstIteratorWithOnlyIndex< TImage >::m_Image {}
protected

Definition at line 250 of file itkImageConstIteratorWithOnlyIndex.h.

◆ m_OffsetTable

template<typename TImage>
OffsetValueType itk::ImageConstIteratorWithOnlyIndex< TImage >::m_OffsetTable[ImageDimension+1] {}
protected

Definition at line 260 of file itkImageConstIteratorWithOnlyIndex.h.

◆ m_PositionIndex

template<typename TImage>
IndexType itk::ImageConstIteratorWithOnlyIndex< TImage >::m_PositionIndex { { 0 } }
protected

◆ m_Region

template<typename TImage>
RegionType itk::ImageConstIteratorWithOnlyIndex< TImage >::m_Region {}
protected

Definition at line 258 of file itkImageConstIteratorWithOnlyIndex.h.

◆ m_Remaining

template<typename TImage>
bool itk::ImageConstIteratorWithOnlyIndex< TImage >::m_Remaining { false }
protected

Definition at line 262 of file itkImageConstIteratorWithOnlyIndex.h.


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