ITK  5.0.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Attributes | List of all members
itk::ImageConstIterator< TImage > Class Template Reference

#include <itkImageConstIterator.h>

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

Detailed Description

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

A multi-dimensional image iterator templated over image type.

A multi-dimensional image iterator templated over image type. Specialized for RLEImage.

ImageConstIterator is a templated class to represent a multi-dimensional iterator. ImageConstIterator is templated over the type of the image to be iterated over.

ImageConstIterator is a base class for all the image iterators. It provides the basic construction and comparison operations. However, it does not provide mechanisms for moving the iterator. A subclass of ImageConstIterator must be used to move the iterator.

ImageConstIterator 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, ImageConstIterator holds a reference to the image over which it is traversing.

ImageConstIterator 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 84 of file itkImageConstIterator.h.

Public Types

using AccessorFunctorType = typename TImage::AccessorFunctorType
 
using AccessorType = typename TImage::AccessorType
 
using ImageType = TImage
 
using IndexType = typename TImage::IndexType
 
using InternalPixelType = typename TImage::InternalPixelType
 
using OffsetType = typename TImage::OffsetType
 
using PixelContainer = typename TImage::PixelContainer
 
using PixelContainerPointer = typename PixelContainer::Pointer
 
using PixelType = typename TImage::PixelType
 
using RegionType = typename TImage::RegionType
 
using Self = ImageConstIterator
 
using SizeType = typename TImage::SizeType
 

Public Member Functions

 ImageConstIterator (const Self &it)
 
 itkTypeMacroNoParent (ImageConstIterator)
 
virtual ~ImageConstIterator ()=default
 
 ImageConstIterator ()
 

Static Public Attributes

static constexpr unsigned int ImageIteratorDimension = TImage::ImageDimension
 
TImage::ConstWeakPointer m_Image
 
RegionType m_Region
 
OffsetValueType m_Offset
 
OffsetValueType m_BeginOffset
 
OffsetValueType m_EndOffset
 
const InternalPixelTypem_Buffer
 
AccessorType m_PixelAccessor
 
AccessorFunctorType m_PixelAccessorFunctor
 
 ImageConstIterator (const ImageType *ptr, const RegionType &region)
 
Selfoperator= (const Self &it)
 
virtual void SetRegion (const RegionType &region)
 
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 operator> (const Self &it) const
 
const IndexType GetIndex () const
 
virtual void SetIndex (const IndexType &ind)
 
const RegionTypeGetRegion () const
 
const ImageTypeGetImage () const
 
PixelType Get () const
 
const PixelTypeValue () const
 
void GoToBegin ()
 
void GoToEnd ()
 
bool IsAtBegin () const
 
bool IsAtEnd () const
 
static unsigned int GetImageIteratorDimension ()
 

Member Typedef Documentation

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

Definition at line 129 of file itkImageConstIterator.h.

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

Accessor type that convert data between internal and external representations.

Definition at line 128 of file itkImageConstIterator.h.

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

Image type alias support

Definition at line 112 of file itkImageConstIterator.h.

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

Index type alias support

Definition at line 100 of file itkImageConstIterator.h.

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

Internal Pixel Type

Definition at line 121 of file itkImageConstIterator.h.

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

Offset type alias support

Definition at line 106 of file itkImageConstIterator.h.

template<typename TImage>
using itk::ImageConstIterator< 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 117 of file itkImageConstIterator.h.

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

Definition at line 118 of file itkImageConstIterator.h.

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

External Pixel Type

Definition at line 124 of file itkImageConstIterator.h.

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

Region type alias support

Definition at line 109 of file itkImageConstIterator.h.

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

Standard class type aliases.

Definition at line 88 of file itkImageConstIterator.h.

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

Size type alias support

Definition at line 103 of file itkImageConstIterator.h.

Constructor & Destructor Documentation

template<typename TImage>
itk::ImageConstIterator< TImage >::ImageConstIterator ( )
inline

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

Definition at line 133 of file itkImageConstIterator.h.

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

Default Destructor.

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

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

Definition at line 152 of file itkImageConstIterator.h.

template<typename TImage>
itk::ImageConstIterator< TImage >::ImageConstIterator ( const ImageType ptr,
const RegionType region 
)
inline

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

Definition at line 169 of file itkImageConstIterator.h.

Member Function Documentation

template<typename TImage>
PixelType itk::ImageConstIterator< TImage >::Get ( ) const
inline
template<typename TImage>
const ImageType* itk::ImageConstIterator< TImage >::GetImage ( ) const
inline
template<typename TImage>
static unsigned int itk::ImageConstIterator< TImage >::GetImageIteratorDimension ( )
inlinestatic

Get the dimension (size) of the index.

Definition at line 243 of file itkImageConstIterator.h.

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

Get the index. This provides a read only reference to the index. This causes the index to be calculated from pointer arithmetic and is therefore an expensive operation.

See Also
SetIndex

Definition at line 308 of file itkImageConstIterator.h.

Referenced by itk::ImageReverseConstIterator< TImage >::ImageReverseConstIterator(), itk::ImageReverseConstIterator< TImage >::operator=(), and itk::ImageConstIterator< RLEImage< TPixel, VImageDimension, CounterType > >::SetRegion().

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

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

Definition at line 318 of file itkImageConstIterator.h.

Referenced by itk::ImageReverseConstIterator< TImage >::ImageReverseConstIterator(), and itk::ImageReverseConstIterator< TImage >::operator=().

template<typename TImage>
void itk::ImageConstIterator< TImage >::GoToBegin ( )
inline

Move an iterator to the beginning of the region. "Begin" is defined as the first pixel in the region.

Definition at line 337 of file itkImageConstIterator.h.

template<typename TImage>
void itk::ImageConstIterator< TImage >::GoToEnd ( )
inline

Move an iterator to the end of the region. "End" is defined as one pixel past the last pixel of the region.

Definition at line 344 of file itkImageConstIterator.h.

template<typename TImage>
bool itk::ImageConstIterator< TImage >::IsAtBegin ( ) const
inline

Is the iterator at the beginning of the region? "Begin" is defined as the first pixel in the region.

Definition at line 351 of file itkImageConstIterator.h.

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

Is the iterator at the end of the region? "End" is defined as one pixel past the last pixel of the region.

Definition at line 358 of file itkImageConstIterator.h.

Referenced by itk::UnaryFunctorWithIndexImageFilter< TInputImage, TOutputImage, TFunctor >::DynamicThreadedGenerateData().

template<typename TImage>
itk::ImageConstIterator< TImage >::itkTypeMacroNoParent ( ImageConstIterator< TImage >  )

Run-time type information (and related methods).

template<typename TImage>
bool itk::ImageConstIterator< 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 249 of file itkImageConstIterator.h.

template<typename TImage>
bool itk::ImageConstIterator< 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 277 of file itkImageConstIterator.h.

template<typename TImage>
bool itk::ImageConstIterator< 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 267 of file itkImageConstIterator.h.

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

operator= is provided to make sure the handle to the image is properly reference counted.

Definition at line 185 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIteratorWithIndex< RLEImage< TPixel, VImageDimension, CounterType > >::ImageConstIteratorWithIndex(), itk::ImageConstIteratorWithOnlyIndex< RLEImage< TPixel, VImageDimension, CounterType > >::ImageConstIteratorWithOnlyIndex(), itk::ImageRegionConstIterator< RLEImage< TPixel, VImageDimension, CounterType > >::ImageRegionConstIterator(), itk::ImageRegionConstIterator< BufferType >::ImageRegionConstIterator(), itk::ImageRegionConstIteratorWithIndex< RLEImage< TPixel, VImageDimension, CounterType > >::ImageRegionConstIteratorWithIndex(), itk::ImageRegionConstIteratorWithOnlyIndex< RLEImage< TPixel, VImageDimension, CounterType > >::ImageRegionConstIteratorWithOnlyIndex(), itk::ImageRegionIterator< RLEImage< TPixel, VImageDimension, CounterType > >::ImageRegionIterator(), itk::ImageRegionIteratorWithIndex< RLEImage< TPixel, VImageDimension, CounterType > >::ImageRegionIteratorWithIndex(), itk::ImageScanlineConstIterator< RLEImage< TPixel, VImageDimension, CounterType > >::ImageScanlineConstIterator(), itk::ImageScanlineConstIterator< TImage >::ImageScanlineConstIterator(), itk::ImageIterator< RLEImage< TPixel, VImageDimension, CounterType > >::operator=(), itk::ImageScanlineIterator< RLEImage< TPixel, VImageDimension, CounterType > >::operator=(), and itk::ImageRegionIterator< RLEImage< TPixel, VImageDimension, CounterType > >::operator=().

template<typename TImage>
bool itk::ImageConstIterator< 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 258 of file itkImageConstIterator.h.

template<typename TImage>
bool itk::ImageConstIterator< 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 297 of file itkImageConstIterator.h.

template<typename TImage>
bool itk::ImageConstIterator< 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 287 of file itkImageConstIterator.h.

template<typename TImage>
virtual void itk::ImageConstIterator< TImage >::SetIndex ( const IndexType ind)
inlinevirtual
template<typename TImage>
virtual void itk::ImageConstIterator< TImage >::SetRegion ( const RegionType region)
inlinevirtual

Set the region of the image to iterate over.

Definition at line 205 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIterator< RLEImage< TPixel, VImageDimension, CounterType > >::ImageConstIterator().

template<typename TImage>
const PixelType& itk::ImageConstIterator< 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 332 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIterator< RLEImage< TPixel, VImageDimension, CounterType > >::Get(), and itk::ImageConstIterator< RLEImage< TPixel, VImageDimension, CounterType > >::Value().

Member Data Documentation

template<typename TImage>
constexpr unsigned int itk::ImageConstIterator< TImage >::ImageIteratorDimension = TImage::ImageDimension
static

Dimension of the image 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 94 of file itkImageConstIterator.h.

template<typename TImage>
OffsetValueType itk::ImageConstIterator< TImage >::m_BeginOffset
protected

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

Definition at line 369 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIterator< BufferType >::ImageConstIterator(), and itk::ImageConstIterator< BufferType >::operator=().

template<typename TImage>
const InternalPixelType* itk::ImageConstIterator< TImage >::m_Buffer
protected
template<typename TImage>
OffsetValueType itk::ImageConstIterator< TImage >::m_EndOffset
protected

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

Definition at line 370 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIterator< BufferType >::ImageConstIterator(), and itk::ImageConstIterator< BufferType >::operator=().

template<typename TImage>
TImage::ConstWeakPointer itk::ImageConstIterator< TImage >::m_Image
protected
template<typename TImage>
OffsetValueType itk::ImageConstIterator< TImage >::m_Offset
protected
template<typename TImage>
AccessorType itk::ImageConstIterator< TImage >::m_PixelAccessor
protected

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

Definition at line 374 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIterator< BufferType >::ImageConstIterator(), and itk::ImageConstIterator< BufferType >::operator=().

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

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

Definition at line 375 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIterator< BufferType >::ImageConstIterator(), and itk::ImageConstIterator< BufferType >::operator=().

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

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

Definition at line 366 of file itkImageConstIterator.h.

Referenced by itk::ImageConstIterator< BufferType >::ImageConstIterator(), and itk::ImageConstIterator< BufferType >::operator=().


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