ITK
6.0.0
Insight Toolkit
|
#include <itkImageConstIterator.h>
A multi-dimensional image iterator templated over image type.
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.
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 | |
PixelType | Get () const |
const ImageType * | GetImage () const |
const IndexType | GetIndex () const |
virtual const char * | GetNameOfClass () const |
const RegionType & | GetRegion () const |
void | GoToBegin () |
void | GoToEnd () |
ImageConstIterator (const Self &it) | |
bool | IsAtBegin () const |
bool | IsAtEnd () const |
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 |
virtual void | SetIndex (const IndexType &ind) |
virtual void | SetRegion (const RegionType ®ion) |
const PixelType & | Value () const |
virtual | ~ImageConstIterator ()=default |
ImageConstIterator () | |
ImageConstIterator (const ImageType *ptr, const RegionType ®ion) | |
Self & | operator= (const Self &it) |
Static Public Member Functions | |
static unsigned int | GetImageIteratorDimension () |
Static Public Attributes | |
static constexpr unsigned int | ImageIteratorDimension = TImage::ImageDimension |
Protected Attributes | |
OffsetValueType | m_BeginOffset {} |
const InternalPixelType * | m_Buffer {} |
OffsetValueType | m_EndOffset {} |
TImage::ConstWeakPointer | m_Image {} |
OffsetValueType | m_Offset {} |
AccessorType | m_PixelAccessor {} |
AccessorFunctorType | m_PixelAccessorFunctor {} |
RegionType | m_Region {} |
using itk::ImageConstIterator< TImage >::AccessorFunctorType = typename TImage::AccessorFunctorType |
Definition at line 129 of file itkImageConstIterator.h.
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.
using itk::ImageConstIterator< TImage >::ImageType = TImage |
Image type alias support
Definition at line 112 of file itkImageConstIterator.h.
using itk::ImageConstIterator< TImage >::IndexType = typename TImage::IndexType |
Index type alias support
Definition at line 100 of file itkImageConstIterator.h.
using itk::ImageConstIterator< TImage >::InternalPixelType = typename TImage::InternalPixelType |
Internal Pixel Type
Definition at line 121 of file itkImageConstIterator.h.
using itk::ImageConstIterator< TImage >::OffsetType = typename TImage::OffsetType |
Offset type alias support
Definition at line 106 of file itkImageConstIterator.h.
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 typedef'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.
using itk::ImageConstIterator< TImage >::PixelContainerPointer = typename PixelContainer::Pointer |
Definition at line 118 of file itkImageConstIterator.h.
using itk::ImageConstIterator< TImage >::PixelType = typename TImage::PixelType |
External Pixel Type
Definition at line 124 of file itkImageConstIterator.h.
using itk::ImageConstIterator< TImage >::RegionType = typename TImage::RegionType |
Region type alias support
Definition at line 109 of file itkImageConstIterator.h.
using itk::ImageConstIterator< TImage >::Self = ImageConstIterator |
Standard class type aliases.
Definition at line 88 of file itkImageConstIterator.h.
using itk::ImageConstIterator< TImage >::SizeType = typename TImage::SizeType |
Size type alias support
Definition at line 103 of file itkImageConstIterator.h.
|
inline |
Default Constructor. Need to provide a default constructor since we provide a copy constructor.
Definition at line 133 of file itkImageConstIterator.h.
|
virtualdefault |
Default Destructor.
|
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.
References itk::ImageConstIterator< TImage >::m_BeginOffset, itk::ImageConstIterator< TImage >::m_Buffer, itk::ImageConstIterator< TImage >::m_EndOffset, itk::ImageConstIterator< TImage >::m_Image, itk::ImageConstIterator< TImage >::m_Offset, itk::ImageConstIterator< TImage >::m_PixelAccessor, itk::ImageConstIterator< TImage >::m_PixelAccessorFunctor, and itk::ImageConstIterator< TImage >::m_Region.
|
inline |
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.
Definition at line 169 of file itkImageConstIterator.h.
|
inline |
Get the pixel value
Definition at line 336 of file itkImageConstIterator.h.
Referenced by itk::MultiphaseFiniteDifferenceImageFilter< TInputImage, TFeatureImage, TOutputImage, TFiniteDifferenceFunction, TIdCell >::SetLevelSet(), and itk::GradientRecursiveGaussianImageFilter< TInputImage, TOutputImage >::TransformOutputPixel().
|
inline |
Get the image that this iterator walks.
Definition at line 329 of file itkImageConstIterator.h.
Referenced by itk::ImageReverseConstIterator< TImage >::ImageReverseConstIterator(), itk::ImageReverseConstIterator< TImage >::operator=(), itk::GradientImageFilter< TInputImage, TOperatorValueType, TOutputValueType, TOutputImageType >::SetOutputPixel(), and itk::GradientRecursiveGaussianImageFilter< TInputImage, TOutputImage >::TransformOutputPixel().
|
inlinestatic |
Get the dimension (size) of the index.
Definition at line 245 of file itkImageConstIterator.h.
|
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.
Definition at line 306 of file itkImageConstIterator.h.
Referenced by itk::ImageReverseConstIterator< TImage >::ImageReverseConstIterator(), and itk::ImageReverseConstIterator< TImage >::operator=().
|
virtual |
|
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 322 of file itkImageConstIterator.h.
Referenced by itk::ImageReverseConstIterator< TImage >::ImageReverseConstIterator(), and itk::ImageReverseConstIterator< TImage >::operator=().
|
inline |
Move an iterator to the beginning of the region. "Begin" is defined as the first pixel in the region.
Definition at line 353 of file itkImageConstIterator.h.
|
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 361 of file itkImageConstIterator.h.
|
inline |
Is the iterator at the beginning of the region? "Begin" is defined as the first pixel in the region.
Definition at line 369 of file itkImageConstIterator.h.
|
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 377 of file itkImageConstIterator.h.
itk::ImageConstIterator< TImage >::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION | ( | Self | ) |
|
inline |
Comparison operator. An iterator is "less than" another if it "points to" a lower memory location.
Definition at line 273 of file itkImageConstIterator.h.
References itk::ImageConstIterator< TImage >::m_Buffer, and itk::ImageConstIterator< TImage >::m_Offset.
|
inline |
Comparison operator. An iterator is "less than" another if it "points to" a lower memory location.
Definition at line 263 of file itkImageConstIterator.h.
References itk::ImageConstIterator< TImage >::m_Buffer, and itk::ImageConstIterator< TImage >::m_Offset.
|
inline |
operator= is provided to make sure the handle to the image is properly reference counted.
Definition at line 185 of file itkImageConstIterator.h.
References itk::ImageConstIterator< TImage >::m_BeginOffset, itk::ImageConstIterator< TImage >::m_Buffer, itk::ImageConstIterator< TImage >::m_EndOffset, itk::ImageConstIterator< TImage >::m_Image, itk::ImageConstIterator< TImage >::m_Offset, itk::ImageConstIterator< TImage >::m_PixelAccessor, itk::ImageConstIterator< TImage >::m_PixelAccessorFunctor, and itk::ImageConstIterator< TImage >::m_Region.
Referenced by itk::ImageRegionConstIterator< TImage >::ImageRegionConstIterator(), and itk::ImageScanlineConstIterator< TImage >::ImageScanlineConstIterator().
|
inline |
Comparison operator. Two iterators are the same if they "point to" the same memory location
Definition at line 253 of file itkImageConstIterator.h.
References itk::ImageConstIterator< TImage >::m_Buffer, and itk::ImageConstIterator< TImage >::m_Offset.
|
inline |
Comparison operator. An iterator is "greater than" another if it "points to" a higher location.
Definition at line 294 of file itkImageConstIterator.h.
References itk::ImageConstIterator< TImage >::m_Buffer, and itk::ImageConstIterator< TImage >::m_Offset.
|
inline |
Comparison operator. An iterator is "greater than" another if it "points to" a higher location.
Definition at line 284 of file itkImageConstIterator.h.
References itk::ImageConstIterator< TImage >::m_Buffer, and itk::ImageConstIterator< TImage >::m_Offset.
|
inlinevirtual |
Set the index. No bounds checking is performed.
Reimplemented in itk::ImageRegionConstIterator< TImage >, itk::ImageRegionConstIterator< ImageType >, and itk::ImageScanlineConstIterator< TImage >.
Definition at line 314 of file itkImageConstIterator.h.
|
inlinevirtual |
Set the region of the image to iterate over.
Definition at line 206 of file itkImageConstIterator.h.
|
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 345 of file itkImageConstIterator.h.
|
staticconstexpr |
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.
|
protected |
Definition at line 388 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), and itk::ImageConstIterator< TImage >::operator=().
|
protected |
Definition at line 391 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), itk::ImageConstIterator< TImage >::operator<(), itk::ImageConstIterator< TImage >::operator<=(), itk::ImageConstIterator< TImage >::operator=(), itk::ImageConstIterator< TImage >::operator==(), itk::ImageConstIterator< TImage >::operator>(), and itk::ImageConstIterator< TImage >::operator>=().
|
protected |
Definition at line 389 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), and itk::ImageConstIterator< TImage >::operator=().
|
protected |
Definition at line 383 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), and itk::ImageConstIterator< TImage >::operator=().
|
protected |
Definition at line 387 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), itk::ImageConstIterator< TImage >::operator<(), itk::ImageConstIterator< TImage >::operator<=(), itk::ImageConstIterator< TImage >::operator=(), itk::ImageConstIterator< TImage >::operator==(), itk::ImageConstIterator< TImage >::operator>(), and itk::ImageConstIterator< TImage >::operator>=().
|
protected |
Definition at line 393 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), and itk::ImageConstIterator< TImage >::operator=().
|
protected |
Definition at line 394 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), and itk::ImageConstIterator< TImage >::operator=().
|
protected |
Definition at line 385 of file itkImageConstIterator.h.
Referenced by itk::ImageConstIterator< TImage >::ImageConstIterator(), and itk::ImageConstIterator< TImage >::operator=().