ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkImageConstIteratorWithIndex.h>
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.
Definition at line 92 of file itkImageConstIteratorWithIndex.h.
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 | |
PixelType | Get () const |
const IndexType & | GetIndex () const |
const RegionType & | GetRegion () const |
void | GoToBegin () |
void | GoToReverseBegin () |
ImageConstIteratorWithIndex () | |
ImageConstIteratorWithIndex (const Self &it) | |
ImageConstIteratorWithIndex (const TImage *ptr, const RegionType ®ion) | |
bool | IsAtEnd () const |
bool | IsAtReverseEnd () const |
bool | operator!= (const Self &it) const |
bool | operator< (const Self &it) const |
bool | operator<= (const Self &it) const |
Self & | operator= (const Self &it) |
bool | operator== (const Self &it) const |
bool | operator> (const Self &it) const |
bool | operator>= (const Self &it) const |
bool | Remaining () |
const PixelType & | Value () const |
virtual | ~ImageConstIteratorWithIndex ()=default |
void | SetIndex (const IndexType &ind) |
Static Public Member Functions | |
static unsigned int | GetImageDimension () |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = TImage::ImageDimension |
Protected Attributes | |
const InternalPixelType * | m_Begin |
IndexType | m_BeginIndex |
const InternalPixelType * | m_End |
IndexType | m_EndIndex |
TImage::ConstWeakPointer | m_Image |
OffsetValueType | m_OffsetTable [ImageDimension+1] |
AccessorType | m_PixelAccessor |
AccessorFunctorType | m_PixelAccessorFunctor |
const InternalPixelType * | m_Position |
IndexType | m_PositionIndex |
RegionType | m_Region |
bool | m_Remaining |
using itk::ImageConstIteratorWithIndex< TImage >::AccessorFunctorType = typename TImage::AccessorFunctorType |
Definition at line 133 of file itkImageConstIteratorWithIndex.h.
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.
using itk::ImageConstIteratorWithIndex< TImage >::ImageType = TImage |
Image type alias support
Definition at line 116 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::IndexType = typename TImage::IndexType |
Index type alias support
Definition at line 105 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::IndexValueType = typename IndexType::IndexValueType |
Definition at line 106 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::InternalPixelType = typename TImage::InternalPixelType |
Internal Pixel Type
Definition at line 125 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::OffsetType = typename TImage::OffsetType |
Type of the Offset taken from the image
Definition at line 136 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::OffsetValueType = typename OffsetType::OffsetValueType |
Definition at line 137 of file itkImageConstIteratorWithIndex.h.
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.
using itk::ImageConstIteratorWithIndex< TImage >::PixelContainerPointer = typename PixelContainer::Pointer |
Definition at line 122 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::PixelType = typename TImage::PixelType |
External Pixel Type
Definition at line 128 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::RegionType = typename TImage::RegionType |
Region type alias support
Definition at line 113 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::Self = ImageConstIteratorWithIndex |
Standard class type aliases.
Definition at line 96 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::SizeType = typename TImage::SizeType |
Size type alias support
Definition at line 109 of file itkImageConstIteratorWithIndex.h.
using itk::ImageConstIteratorWithIndex< TImage >::SizeValueType = typename SizeType::SizeValueType |
Definition at line 110 of file itkImageConstIteratorWithIndex.h.
itk::ImageConstIteratorWithIndex< TImage >::ImageConstIteratorWithIndex | ( | ) |
Default Constructor. Need to provide a default constructor since we provide a copy constructor.
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.
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.
|
virtualdefault |
Default Destructor.
|
inline |
Get the pixel value
Definition at line 247 of file itkImageConstIteratorWithIndex.h.
|
inlinestatic |
Get the dimension (size) of the index.
Definition at line 160 of file itkImageConstIteratorWithIndex.h.
|
inline |
Get the index. This provides a read only reference to the index.
Definition at line 225 of file itkImageConstIteratorWithIndex.h.
Referenced by itk::UnaryFunctorWithIndexImageFilter< TInputImage, TOutputImage, TFunctor >::DynamicThreadedGenerateData(), and itk::FrequencyImageRegionConstIteratorWithIndex< TImage >::GetFrequencyBin().
|
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 232 of file itkImageConstIteratorWithIndex.h.
void itk::ImageConstIteratorWithIndex< TImage >::GoToBegin | ( | ) |
Move an iterator to the beginning of the region.
Referenced by itk::UnaryFunctorWithIndexImageFilter< TInputImage, TOutputImage, TFunctor >::DynamicThreadedGenerateData(), and itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::SetBinaryMask().
void itk::ImageConstIteratorWithIndex< TImage >::GoToReverseBegin | ( | ) |
Move an iterator to the End of the region.
|
inline |
Is the iterator at the end of the region?
Definition at line 273 of file itkImageConstIteratorWithIndex.h.
|
inline |
Is the iterator at the beginning of the region?
Definition at line 267 of file itkImageConstIteratorWithIndex.h.
|
inline |
Comparison operator. Two iterators are the same if they "point to" the same memory location
Definition at line 168 of file itkImageConstIteratorWithIndex.h.
|
inline |
Comparison operator. An iterator is "less than" another if it "points to" a lower memory location.
Definition at line 196 of file itkImageConstIteratorWithIndex.h.
|
inline |
Comparison operator. An iterator is "less than" another if it "points to" a lower memory location.
Definition at line 186 of file itkImageConstIteratorWithIndex.h.
Self& itk::ImageConstIteratorWithIndex< TImage >::operator= | ( | const Self & | it | ) |
operator= is provided to make sure the handle to the image is properly reference counted.
Referenced by itk::ImageLinearConstIteratorWithIndex< TImageType >::ImageLinearConstIteratorWithIndex(), itk::ImageRandomConstIteratorWithIndex< TImage >::ImageRandomConstIteratorWithIndex(), itk::ImageRandomNonRepeatingConstIteratorWithIndex< TImage >::ImageRandomNonRepeatingConstIteratorWithIndex(), itk::ImageRegionConstIteratorWithIndex< TImage >::ImageRegionConstIteratorWithIndex(), itk::ImageRegionIteratorWithIndex< RLEImage< TPixel, VImageDimension, CounterType > >::ImageRegionIteratorWithIndex(), itk::ImageSliceConstIteratorWithIndex< TImage >::ImageSliceConstIteratorWithIndex(), itk::FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex< TImage >::operator=(), itk::FrequencyHalfHermitianFFTLayoutImageRegionIteratorWithIndex< TImage >::operator=(), itk::FrequencyFFTLayoutImageRegionIteratorWithIndex< TImage >::operator=(), and itk::FrequencyImageRegionIteratorWithIndex< TImage >::operator=().
|
inline |
Comparison operator. Two iterators are the same if they "point to" the same memory location
Definition at line 177 of file itkImageConstIteratorWithIndex.h.
|
inline |
Comparison operator. An iterator is "greater than" another if it "points to" a higher location.
Definition at line 216 of file itkImageConstIteratorWithIndex.h.
|
inline |
Comparison operator. An iterator is "greater than" another if it "points to" a higher location.
Definition at line 206 of file itkImageConstIteratorWithIndex.h.
|
inline |
Are there data remaining in the region ?
Definition at line 279 of file itkImageConstIteratorWithIndex.h.
|
inline |
Set the index. No bounds checking is performed.
Definition at line 239 of file itkImageConstIteratorWithIndex.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 255 of file itkImageConstIteratorWithIndex.h.
Referenced by itk::UnaryFunctorWithIndexImageFilter< TInputImage, TOutputImage, TFunctor >::DynamicThreadedGenerateData().
|
static |
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.
|
protected |
Definition at line 298 of file itkImageConstIteratorWithIndex.h.
|
protected |
Definition at line 288 of file itkImageConstIteratorWithIndex.h.
|
protected |
Definition at line 299 of file itkImageConstIteratorWithIndex.h.
|
protected |
Definition at line 289 of file itkImageConstIteratorWithIndex.h.
|
protected |
Definition at line 285 of file itkImageConstIteratorWithIndex.h.
Referenced by itk::ImageIteratorWithIndex< RLEImage< TPixel, VImageDimension, CounterType > >::GetImage(), itk::FrequencyImageRegionConstIteratorWithIndex< TImage >::Init(), itk::FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage >::Init(), itk::FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage >::Init(), itk::FrequencyHalfHermitianFFTLayoutImageRegionConstIteratorWithIndex< TImage >::Init(), itk::ImageRegionIteratorWithIndex< RLEImage< TPixel, VImageDimension, CounterType > >::Set(), itk::ImageIteratorWithIndex< RLEImage< TPixel, VImageDimension, CounterType > >::Set(), and itk::FrequencyHalfHermitianFFTLayoutImageRegionConstIteratorWithIndex< TImage >::SetActualXDimensionIsOdd().
|
protected |
Definition at line 295 of file itkImageConstIteratorWithIndex.h.
|
protected |
Definition at line 303 of file itkImageConstIteratorWithIndex.h.
|
protected |
Definition at line 304 of file itkImageConstIteratorWithIndex.h.
Referenced by itk::FrequencyFFTLayoutImageRegionIteratorWithIndex< TImage >::Set(), itk::FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex< TImage >::Set(), itk::FrequencyImageRegionIteratorWithIndex< TImage >::Set(), and itk::FrequencyHalfHermitianFFTLayoutImageRegionIteratorWithIndex< TImage >::Set().
|
protected |
Definition at line 297 of file itkImageConstIteratorWithIndex.h.
Referenced by itk::ImageConstIteratorWithIndex< TImageType >::operator!=(), itk::ImageConstIteratorWithIndex< TImageType >::operator<(), itk::ImageConstIteratorWithIndex< TImageType >::operator<=(), itk::ImageConstIteratorWithIndex< TImageType >::operator==(), itk::ImageConstIteratorWithIndex< TImageType >::operator>(), itk::ImageConstIteratorWithIndex< TImageType >::operator>=(), itk::FrequencyImageRegionIteratorWithIndex< TImage >::Set(), itk::FrequencyHalfHermitianFFTLayoutImageRegionIteratorWithIndex< TImage >::Set(), itk::FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex< TImage >::Set(), itk::FrequencyFFTLayoutImageRegionIteratorWithIndex< TImage >::Set(), itk::FrequencyHalfHermitianFFTLayoutImageRegionIteratorWithIndex< TImage >::Value(), itk::FrequencyImageRegionIteratorWithIndex< TImage >::Value(), itk::FrequencyFFTLayoutImageRegionIteratorWithIndex< TImage >::Value(), and itk::FrequencyShiftedFFTLayoutImageRegionIteratorWithIndex< TImage >::Value().
|
protected |
Definition at line 287 of file itkImageConstIteratorWithIndex.h.
Referenced by itk::FrequencyShiftedFFTLayoutImageRegionConstIteratorWithIndex< TImage >::GetFrequencyBin(), itk::FrequencyFFTLayoutImageRegionConstIteratorWithIndex< TImage >::GetFrequencyBin(), and itk::FrequencyHalfHermitianFFTLayoutImageRegionConstIteratorWithIndex< TImage >::GetFrequencyBin().
|
protected |
Definition at line 293 of file itkImageConstIteratorWithIndex.h.
|
protected |
Definition at line 301 of file itkImageConstIteratorWithIndex.h.