#include <itkImageScanlineIterator.h>
A multi-dimensional iterator templated over image type that walks a region of pixels, scanline by scanline or in the direction of the fastest axis.
The itk::ImageScanlineIterator is optimized for iteration speed and is the first choice for pixel-wise operations on an image. This iterator is preferred over the older ImageRegionConstIterator even when knowledge of the current line state is not desired because of its speed.
The following is sample usage:
Iterating beyond the end of a line results it undefined behavior.
Definition at line 63 of file itkImageScanlineIterator.h.
Inheritance diagram for itk::ImageScanlineIterator< TImage >:
Collaboration diagram for itk::ImageScanlineIterator< TImage >:Public Types | |
| using | AccessorType |
| using | ImageType |
| using | IndexType |
| using | InternalPixelType |
| using | OffsetType |
| using | PixelContainer |
| using | PixelContainerPointer |
| using | PixelType |
| using | RegionType |
| using | Self = ImageScanlineIterator |
| using | SizeType |
| using | Superclass = ImageIterator<TImage> |
Public Types inherited from itk::ImageIterator< TImage > | |
| using | AccessorFunctorType = typename TImage::AccessorFunctorType |
| using | AccessorType = typename TImage::AccessorType |
| using | ImageType = detail::IteratorImageType_t<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 = ImageIterator |
| using | SizeType = typename TImage::SizeType |
Public Member Functions | |
| virtual const char * | GetNameOfClass () const |
| void | GoToBegin () |
| void | GoToBeginOfLine () |
| void | GoToEnd () |
| void | GoToEndOfLine () |
| ImageScanlineIterator ()=default | |
| template<typename TOtherImage, std::enable_if_t< detail::IsImageIteratorConvertible_v< TOtherImage, TImage >, int > = 0> | |
| ImageScanlineIterator (const ImageIterator< TOtherImage > &it) | |
| template<typename TOtherImage, std::enable_if_t< detail::IsImageIteratorConvertible_v< TOtherImage, TImage >, int > = 0> | |
| ImageScanlineIterator (const ImageScanlineIterator< TOtherImage > &it) | |
| ImageScanlineIterator (TImage *ptr, const RegionType ®ion) | |
| bool | IsAtEndOfLine () const |
| void | NextLine () |
| Self & | operator++ () |
| Self & | operator-- () |
| void | SetIndex (const IndexType &ind) override |
Public Member Functions inherited from itk::ImageIterator< TImage > | |
| IndexType | ComputeIndex () const |
| PixelType | Get () const |
| TImage * | GetImage () const |
| const RegionType & | GetRegion () const |
| void | GoToBegin () |
| void | GoToEnd () |
| ImageIterator () | |
| template<typename TOtherImage, std::enable_if_t< detail::IsImageIteratorConvertible_v< TOtherImage, TImage >, int > = 0> | |
| ImageIterator (const ImageIterator< TOtherImage > &it) | |
| ImageIterator (const Self &)=default | |
| ImageIterator (TImage *ptr, const RegionType ®ion) | |
| bool | IsAtBegin () const |
| bool | IsAtEnd () const |
| template<typename TOtherImage, std::enable_if_t< std::is_same_v< std::remove_const_t< TOtherImage >, std::remove_const_t< TImage > >, int > = 0> | |
| bool | operator!= (const ImageIterator< TOtherImage > &it) const |
| template<typename TOtherImage, std::enable_if_t< std::is_same_v< std::remove_const_t< TOtherImage >, std::remove_const_t< TImage > >, int > = 0> | |
| bool | operator< (const ImageIterator< TOtherImage > &it) const |
| template<typename TOtherImage, std::enable_if_t< std::is_same_v< std::remove_const_t< TOtherImage >, std::remove_const_t< TImage > >, int > = 0> | |
| bool | operator<= (const ImageIterator< TOtherImage > &it) const |
| Self & | operator= (const Self &)=default |
| template<typename TOtherImage, std::enable_if_t< std::is_same_v< std::remove_const_t< TOtherImage >, std::remove_const_t< TImage > >, int > = 0> | |
| bool | operator== (const ImageIterator< TOtherImage > &it) const |
| template<typename TOtherImage, std::enable_if_t< std::is_same_v< std::remove_const_t< TOtherImage >, std::remove_const_t< TImage > >, int > = 0> | |
| bool | operator> (const ImageIterator< TOtherImage > &it) const |
| template<typename TOtherImage, std::enable_if_t< std::is_same_v< std::remove_const_t< TOtherImage >, std::remove_const_t< TImage > >, int > = 0> | |
| bool | operator>= (const ImageIterator< TOtherImage > &it) const |
| template<typename T = TImage, std::enable_if_t< std::is_same_v< T, TImage > &&!std::is_const_v< T >, int > = 0> | |
| void | Set (const PixelType &value) const |
| virtual void | SetRegion (const RegionType ®ion) |
| template<typename T = TImage, std::enable_if_t< std::is_same_v< T, TImage > &&!std::is_const_v< T >, int > = 0> | |
| PixelType & | Value () |
| const PixelType & | Value () const |
| virtual | ~ImageIterator ()=default |
Static Public Attributes | |
| static constexpr unsigned int | ImageIteratorDimension = Superclass::ImageIteratorDimension |
Static Public Attributes inherited from itk::ImageIterator< TImage > | |
| static constexpr unsigned int | ImageIteratorDimension = TImage::ImageDimension |
Protected Attributes | |
| OffsetValueType | m_SpanBeginOffset {} |
| OffsetValueType | m_SpanEndOffset {} |
Protected Attributes inherited from itk::ImageIterator< TImage > | |
| OffsetValueType | m_BeginOffset {} |
| std::conditional_t< std::is_const_v< TImage >, const InternalPixelType, InternalPixelType > * | m_Buffer {} |
| OffsetValueType | m_EndOffset {} |
| WeakPointer< TImage > | m_Image {} |
| OffsetValueType | m_Offset {} |
| AccessorType | m_PixelAccessor {} |
| AccessorFunctorType | m_PixelAccessorFunctor {} |
| RegionType | m_Region {} |
Friends | |
| template<typename> | |
| class | ImageScanlineIterator |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::ImageIterator< TImage > | |
| static unsigned int | GetImageIteratorDimension () |
| using itk::ImageIterator< TImage >::AccessorType |
Accessor type that convert data between internal and external representations.
Definition at line 154 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::ImageType |
Image type alias support
Definition at line 139 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::IndexType |
Index type alias support
Definition at line 127 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::InternalPixelType |
Internal Pixel Type
Definition at line 147 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::OffsetType |
Offset type alias support
Definition at line 133 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::PixelContainer |
PixelContainer type alias support. Used to refer to the container for the pixel data.
Definition at line 143 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::PixelContainerPointer |
Definition at line 144 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::PixelType |
External Pixel Type
Definition at line 150 of file itkImageIterator.h.
| using itk::ImageIterator< TImage >::RegionType |
Region type alias support
Definition at line 136 of file itkImageIterator.h.
| using itk::ImageScanlineIterator< TImage >::Self = ImageScanlineIterator |
Standard class type alias.
Definition at line 70 of file itkImageScanlineIterator.h.
| using itk::ImageIterator< TImage >::SizeType |
Size type alias support
Definition at line 130 of file itkImageIterator.h.
| using itk::ImageScanlineIterator< TImage >::Superclass = ImageIterator<TImage> |
Definition at line 71 of file itkImageScanlineIterator.h.
|
default |
Default constructor.
|
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 99 of file itkImageScanlineIterator.h.
|
inline |
Constructor that can be used to cast from an ImageIterator to an ImageScanlineIterator. Many routines return an ImageIterator, but for a particular task, you may want an ImageScanlineIterator. Rather than provide overloaded APIs that return different types of Iterators, itk returns ImageIterators and uses constructors to cast from an ImageIterator to a ImageScanlineIterator.
Definition at line 112 of file itkImageScanlineIterator.h.
|
inline |
Conversion from a writable iterator to a read-only iterator.
Definition at line 123 of file itkImageScanlineIterator.h.
|
virtual |
Reimplemented from itk::ImageIterator< TImage >.
Reimplemented in itk::ImageScanlineConstIterator< TImage >, itk::ImageScanlineConstIterator< InputImageType >, and itk::ImageScanlineConstIterator< InputImageType >.
|
inline |
Move an iterator to the beginning of the region. "Begin" is defined as the first pixel in the region.
Definition at line 132 of file itkImageScanlineIterator.h.
|
inline |
Go to the beginning pixel of the current line.
Definition at line 164 of file itkImageScanlineIterator.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 147 of file itkImageScanlineIterator.h.
|
inline |
Go to the past end pixel of the current line.
Definition at line 178 of file itkImageScanlineIterator.h.
|
inlinenodiscard |
Test if the index is at the end of line
Definition at line 186 of file itkImageScanlineIterator.h.
| void itk::ImageScanlineIterator< TImage >::NextLine | ( | ) |
Go to the next line.
The iterator always moves to the beginning of the next line. If the iterator is on the last scanline then no action is performed.
|
inline |
Increment (prefix) along the scanline the iterator's index.
If the iterator is at the end of the scanline ( one past the last valid element in the row ), then the results are undefined. Which means is may assert in debug mode or result in an undefined iterator which may have unknown consequences if used.
Definition at line 225 of file itkImageScanlineIterator.h.
|
inline |
decrement (prefix) along the scanline the iterator's index.
Definition at line 236 of file itkImageScanlineIterator.h.
|
inlineoverridevirtual |
Set the index without bounds checking.
This is overridden from the parent because we have an extra ivar.
Reimplemented from itk::ImageIterator< TImage >.
Definition at line 198 of file itkImageScanlineIterator.h.
Definition at line 66 of file itkImageScanlineIterator.h.
|
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 77 of file itkImageScanlineIterator.h.
|
protected |
Definition at line 244 of file itkImageScanlineIterator.h.
|
protected |
Definition at line 245 of file itkImageScanlineIterator.h.