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

#include <itkImageConstIteratorWithIndex.h>

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

Public Types

using AccessorFunctorType = typename TImage::AccessorFunctorType
 
using AccessorType = typename TImage::AccessorType
 
using ImageType = TImage
 
using IndexType = typename TImage::IndexType
 
using IndexValueType = typename IndexType::IndexValueType
 
using InternalPixelType = typename TImage::InternalPixelType
 
using OffsetType = typename TImage::OffsetType
 
using OffsetValueType = typename OffsetType::OffsetValueType
 
using PixelContainer = typename TImage::PixelContainer
 
using PixelContainerPointer = typename PixelContainer::Pointer
 
using PixelType = typename TImage::PixelType
 
using RegionType = typename TImage::RegionType
 
using Self = ImageConstIteratorWithIndex
 
using SizeType = typename TImage::SizeType
 
using SizeValueType = typename SizeType::SizeValueType
 

Public Member Functions

const IndexTypeGetIndex () const
 
const RegionTypeGetRegion () const
 
 ImageConstIteratorWithIndex ()
 
 ImageConstIteratorWithIndex (const Self &it)
 
 ImageConstIteratorWithIndex (const TImage *ptr, const RegionType &region)
 
bool operator!= (const Self &it) const
 
bool operator< (const Self &it) const
 
bool operator<= (const Self &it) const
 
Selfoperator= (const Self &it)
 
bool operator== (const Self &it) const
 
bool operator> (const Self &it) const
 
bool operator>= (const Self &it) const
 
virtual ~ImageConstIteratorWithIndex ()=default
 

Static Public Member Functions

static unsigned int GetImageDimension ()
 

Static Public Attributes

static constexpr unsigned int ImageDimension = TImage::ImageDimension
 
TImage::ConstWeakPointer m_Image
 
IndexType m_PositionIndex
 
IndexType m_BeginIndex
 
IndexType m_EndIndex
 
RegionType m_Region
 
OffsetValueType m_OffsetTable [ImageDimension+1]
 
const InternalPixelTypem_Position
 
const InternalPixelTypem_Begin
 
const InternalPixelTypem_End
 
bool m_Remaining
 
AccessorType m_PixelAccessor
 
AccessorFunctorType m_PixelAccessorFunctor
 
void SetIndex (const IndexType &ind)
 
PixelType Get () const
 
const PixelTypeValue () const
 
void GoToBegin ()
 
void GoToReverseBegin ()
 
bool IsAtReverseEnd () const
 
bool IsAtEnd () const
 
bool Remaining ()
 

Detailed Description

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

A base class for multi-dimensional iterators templated over image type that are designed to efficiently keep track of the iterator position.

ImageConstIteratorWithIndex is a templated class to represent a multi-dimensional iterator, and is templated over both the dimension and data type of the image.

ImageConstIteratorWithIndex is a base class for the "WithIndex" 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 ImageConstIteratorWithIndex must be used to move the iterator.

ImageConstIteratorWithIndex 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 buffer, the size of the region, the start index of the buffer, and the start index of the region. To gain access to this information, ImageConstIteratorWithIndex holds a reference to the image over which it is traversing.

ImageConstIteratorWithIndex assumes a particular layout of the image data. In particular, the data is arranged in a 1D array as if it were [][][][slice][row][col] with Index[0] = col, Index[1] = row, Index[2] = slice, etc.

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
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 92 of file itkImageConstIteratorWithIndex.h.

Member Typedef Documentation

◆ AccessorFunctorType

template<typename TImage>
using itk::ImageConstIteratorWithIndex< TImage >::AccessorFunctorType = typename TImage::AccessorFunctorType

Definition at line 133 of file itkImageConstIteratorWithIndex.h.

◆ AccessorType

template<typename TImage>
using itk::ImageConstIteratorWithIndex< TImage >::AccessorType = typename TImage::AccessorType

Accessor type that converts data between internal and external representations.

Definition at line 132 of file itkImageConstIteratorWithIndex.h.

◆ ImageType

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

Image type alias support

Definition at line 116 of file itkImageConstIteratorWithIndex.h.

◆ IndexType

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

Index type alias support

Definition at line 105 of file itkImageConstIteratorWithIndex.h.

◆ IndexValueType

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

Definition at line 106 of file itkImageConstIteratorWithIndex.h.

◆ InternalPixelType

template<typename TImage>
using itk::ImageConstIteratorWithIndex< TImage >::InternalPixelType = typename TImage::InternalPixelType

Internal Pixel Type

Definition at line 125 of file itkImageConstIteratorWithIndex.h.

◆ OffsetType

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

Type of the Offset taken from the image

Definition at line 136 of file itkImageConstIteratorWithIndex.h.

◆ OffsetValueType

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

Definition at line 137 of file itkImageConstIteratorWithIndex.h.

◆ PixelContainer

template<typename TImage>
using itk::ImageConstIteratorWithIndex< TImage >::PixelContainer = typename TImage::PixelContainer

PixelContainer type alias support Used to refer to the container for the pixel data. While this was already typdef'ed in the superclass, it needs to be redone here for this subclass to compile properly with gcc.

Definition at line 121 of file itkImageConstIteratorWithIndex.h.

◆ PixelContainerPointer

template<typename TImage>
using itk::ImageConstIteratorWithIndex< TImage >::PixelContainerPointer = typename PixelContainer::Pointer

Definition at line 122 of file itkImageConstIteratorWithIndex.h.

◆ PixelType

template<typename TImage>
using itk::ImageConstIteratorWithIndex< TImage >::PixelType = typename TImage::PixelType

External Pixel Type

Definition at line 128 of file itkImageConstIteratorWithIndex.h.

◆ RegionType

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

Region type alias support

Definition at line 113 of file itkImageConstIteratorWithIndex.h.

◆ Self

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

Standard class type aliases.

Definition at line 96 of file itkImageConstIteratorWithIndex.h.

◆ SizeType

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

Size type alias support

Definition at line 109 of file itkImageConstIteratorWithIndex.h.

◆ SizeValueType

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

Definition at line 110 of file itkImageConstIteratorWithIndex.h.

Constructor & Destructor Documentation

◆ ImageConstIteratorWithIndex() [1/3]

template<typename TImage>
itk::ImageConstIteratorWithIndex< TImage >::ImageConstIteratorWithIndex ( )

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

◆ ImageConstIteratorWithIndex() [2/3]

template<typename TImage>
itk::ImageConstIteratorWithIndex< TImage >::ImageConstIteratorWithIndex ( const Self it)

Copy Constructor. The copy constructor is provided to make sure the handle to the image is properly reference counted.

◆ ImageConstIteratorWithIndex() [3/3]

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

Constructor establishes an iterator to walk a particular image and a particular region of that image.

◆ ~ImageConstIteratorWithIndex()

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

Default Destructor.

Member Function Documentation

◆ Get()

template<typename TImage>
PixelType itk::ImageConstIteratorWithIndex< TImage >::Get ( ) const
inline

Get the pixel value

Definition at line 252 of file itkImageConstIteratorWithIndex.h.

◆ GetImageDimension()

template<typename TImage>
static unsigned int itk::ImageConstIteratorWithIndex< TImage >::GetImageDimension ( )
inlinestatic

Get the dimension (size) of the index.

Definition at line 161 of file itkImageConstIteratorWithIndex.h.

◆ GetIndex()

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

◆ GetRegion()

template<typename TImage>
const RegionType& itk::ImageConstIteratorWithIndex< 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 235 of file itkImageConstIteratorWithIndex.h.

◆ GoToBegin()

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

◆ GoToReverseBegin()

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

Move an iterator to the End of the region.

◆ IsAtEnd()

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

Is the iterator at the end of the region?

Definition at line 283 of file itkImageConstIteratorWithIndex.h.

◆ IsAtReverseEnd()

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

Is the iterator at the beginning of the region?

Definition at line 276 of file itkImageConstIteratorWithIndex.h.

◆ operator!=()

template<typename TImage>
bool itk::ImageConstIteratorWithIndex< 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 169 of file itkImageConstIteratorWithIndex.h.

◆ operator<()

template<typename TImage>
bool itk::ImageConstIteratorWithIndex< 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 197 of file itkImageConstIteratorWithIndex.h.

◆ operator<=()

template<typename TImage>
bool itk::ImageConstIteratorWithIndex< 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 187 of file itkImageConstIteratorWithIndex.h.

◆ operator=()

template<typename TImage>
Self& itk::ImageConstIteratorWithIndex< TImage >::operator= ( const Self it)

◆ operator==()

template<typename TImage>
bool itk::ImageConstIteratorWithIndex< 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 178 of file itkImageConstIteratorWithIndex.h.

◆ operator>()

template<typename TImage>
bool itk::ImageConstIteratorWithIndex< 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 217 of file itkImageConstIteratorWithIndex.h.

◆ operator>=()

template<typename TImage>
bool itk::ImageConstIteratorWithIndex< 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 207 of file itkImageConstIteratorWithIndex.h.

◆ Remaining()

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

Are there data remaining in the region ?

Definition at line 290 of file itkImageConstIteratorWithIndex.h.

◆ SetIndex()

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

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 243 of file itkImageConstIteratorWithIndex.h.

◆ Value()

template<typename TImage>
const PixelType& itk::ImageConstIteratorWithIndex< TImage >::Value ( ) const
inline

Return a const reference to the pixel This method will provide the fastest access to pixel data, but it will NOT support ImageAdaptors.

Definition at line 261 of file itkImageConstIteratorWithIndex.h.

Member Data Documentation

◆ ImageDimension

template<typename TImage>
constexpr unsigned int itk::ImageConstIteratorWithIndex< 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 102 of file itkImageConstIteratorWithIndex.h.

◆ m_Begin

template<typename TImage>
const InternalPixelType* itk::ImageConstIteratorWithIndex< TImage >::m_Begin
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 309 of file itkImageConstIteratorWithIndex.h.

◆ m_BeginIndex

template<typename TImage>
IndexType itk::ImageConstIteratorWithIndex< TImage >::m_BeginIndex
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 299 of file itkImageConstIteratorWithIndex.h.

◆ m_End

template<typename TImage>
const InternalPixelType* itk::ImageConstIteratorWithIndex< TImage >::m_End
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 310 of file itkImageConstIteratorWithIndex.h.

◆ m_EndIndex

template<typename TImage>
IndexType itk::ImageConstIteratorWithIndex< TImage >::m_EndIndex
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 300 of file itkImageConstIteratorWithIndex.h.

◆ m_Image

template<typename TImage>
TImage::ConstWeakPointer itk::ImageConstIteratorWithIndex< TImage >::m_Image
protected

◆ m_OffsetTable

template<typename TImage>
OffsetValueType itk::ImageConstIteratorWithIndex< TImage >::m_OffsetTable[ImageDimension+1]
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 306 of file itkImageConstIteratorWithIndex.h.

◆ m_PixelAccessor

template<typename TImage>
AccessorType itk::ImageConstIteratorWithIndex< TImage >::m_PixelAccessor
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 314 of file itkImageConstIteratorWithIndex.h.

◆ m_PixelAccessorFunctor

template<typename TImage>
AccessorFunctorType itk::ImageConstIteratorWithIndex< TImage >::m_PixelAccessorFunctor
protected

◆ m_Position

template<typename TImage>
const InternalPixelType* itk::ImageConstIteratorWithIndex< TImage >::m_Position
protected

◆ m_PositionIndex

template<typename TImage>
IndexType itk::ImageConstIteratorWithIndex< TImage >::m_PositionIndex
protected

◆ m_Region

template<typename TImage>
RegionType itk::ImageConstIteratorWithIndex< TImage >::m_Region
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 304 of file itkImageConstIteratorWithIndex.h.

◆ m_Remaining

template<typename TImage>
bool itk::ImageConstIteratorWithIndex< TImage >::m_Remaining
protected

Set the index. No bounds checking is performed.

See also
GetIndex

Definition at line 312 of file itkImageConstIteratorWithIndex.h.


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