ITK  5.2.0
Insight Toolkit
Classes | Public Types | Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
itk::Experimental::ImageRegionRange< TImage > Class Template Referencefinal

#include <itkImageRegionRange.h>

+ Collaboration diagram for itk::Experimental::ImageRegionRange< TImage >:

Classes

class  QualifiedIterator
 

Public Types

using const_iterator = QualifiedIterator< true >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using iterator = QualifiedIterator< IsImageTypeConst >
 
using reverse_iterator = std::reverse_iterator< iterator >
 

Public Member Functions

 ImageRegionRange () noexcept=default
 
 ImageRegionRange (TImage &image, const RegionType &iterationRegion)
 
 ImageRegionRange (TImage &image)
 
iterator begin () const noexcept
 
iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () const noexcept
 
reverse_iterator rend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
std::vcl_size_t size () const noexcept
 
bool empty () const noexcept
 
 ~ImageRegionRange ()=default
 

Private Types

using BufferIteratorType = typename ImageBufferRange< TImage >::iterator
 
using ImageDimensionType = typename TImage::ImageDimensionType
 
using IndexType = typename RegionType::IndexType
 
using OffsetTableType = Offset< ImageDimension+1 >
 
using OffsetType = typename TImage::OffsetType
 
using PixelType = typename TImage::PixelType
 
using RegionType = typename TImage::RegionType
 
using Self = ImageRegionRange
 
using SizeType = typename TImage::SizeType
 

Static Private Member Functions

static OffsetValueType ComputeOffset (const OffsetTableType &offsetTable, const IndexType &bufferedRegionIndex, const IndexType &index)
 

Private Attributes

BufferIteratorType m_BufferBegin {}
 
IndexType m_BufferedRegionIndex { {} }
 
IndexType m_IterationRegionIndex { {} }
 
SizeType m_IterationRegionSize { {} }
 
OffsetTableType m_OffsetTable { {} }
 

Static Private Attributes

static constexpr ImageDimensionType ImageDimension = TImage::ImageDimension
 
static constexpr bool IsImageTypeConst = std::is_const<TImage>::value
 

Detailed Description

template<typename TImage>
class itk::Experimental::ImageRegionRange< TImage >

Modern C++11 range to iterate over the pixels of an image region. Designed to conform to Standard C++ Iterator requirements, so that it can be used in range-based for loop, and passed to Standard C++ algorithms.

The following example adds 42 to each pixel, using a range-based for loop:

ImageRegionRange<ImageType> range{ *image, imageRegion };
for (auto&& pixel : range)
{
pixel = pixel + 42;
}

The following example prints the values of the pixels:

for (const auto pixel : range)
{
std::cout << pixel << std::endl;
}
Author
Niels Dekker, LKEB, Leiden University Medical Center
See also
ImageRegionIterator
ImageRegionIndexRange
ImageBufferRange
ShapedImageNeighborhoodRange

Definition at line 74 of file itkImageRegionRange.h.

Member Typedef Documentation

◆ BufferIteratorType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::BufferIteratorType = typename ImageBufferRange<TImage>::iterator
private

Definition at line 84 of file itkImageRegionRange.h.

◆ const_iterator

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::const_iterator = QualifiedIterator<true>

Definition at line 327 of file itkImageRegionRange.h.

◆ const_reverse_iterator

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 330 of file itkImageRegionRange.h.

◆ ImageDimensionType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::ImageDimensionType = typename TImage::ImageDimensionType
private

Definition at line 78 of file itkImageRegionRange.h.

◆ IndexType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::IndexType = typename RegionType::IndexType
private

Definition at line 89 of file itkImageRegionRange.h.

◆ iterator

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::iterator = QualifiedIterator<IsImageTypeConst>

Definition at line 328 of file itkImageRegionRange.h.

◆ OffsetTableType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::OffsetTableType = Offset<ImageDimension + 1>
private

Definition at line 88 of file itkImageRegionRange.h.

◆ OffsetType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::OffsetType = typename TImage::OffsetType
private

Definition at line 87 of file itkImageRegionRange.h.

◆ PixelType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::PixelType = typename TImage::PixelType
private

Definition at line 79 of file itkImageRegionRange.h.

◆ RegionType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::RegionType = typename TImage::RegionType
private

Definition at line 85 of file itkImageRegionRange.h.

◆ reverse_iterator

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 329 of file itkImageRegionRange.h.

◆ Self

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::Self = ImageRegionRange
private

Definition at line 77 of file itkImageRegionRange.h.

◆ SizeType

template<typename TImage >
using itk::Experimental::ImageRegionRange< TImage >::SizeType = typename TImage::SizeType
private

Definition at line 86 of file itkImageRegionRange.h.

Constructor & Destructor Documentation

◆ ImageRegionRange() [1/3]

template<typename TImage >
itk::Experimental::ImageRegionRange< TImage >::ImageRegionRange ( )
defaultnoexcept

Constructs an empty range

◆ ImageRegionRange() [2/3]

template<typename TImage >
itk::Experimental::ImageRegionRange< TImage >::ImageRegionRange ( TImage &  image,
const RegionType iterationRegion 
)
inlineexplicit

Constructs an object, representing the range of pixels of the specified region, within the specified image.

Definition at line 341 of file itkImageRegionRange.h.

◆ ImageRegionRange() [3/3]

template<typename TImage >
itk::Experimental::ImageRegionRange< TImage >::ImageRegionRange ( TImage &  image)
inlineexplicit

Constructs a range of the pixels of the requested region of an image.

Definition at line 373 of file itkImageRegionRange.h.

◆ ~ImageRegionRange()

template<typename TImage >
itk::Experimental::ImageRegionRange< TImage >::~ImageRegionRange ( )
default

Explicitly-defaulted destructor.

Member Function Documentation

◆ begin()

template<typename TImage >
iterator itk::Experimental::ImageRegionRange< TImage >::begin ( ) const
inlinenoexcept

◆ cbegin()

template<typename TImage >
const_iterator itk::Experimental::ImageRegionRange< TImage >::cbegin ( ) const
inlinenoexcept

Returns a const iterator to the first pixel. Provides only read-only access to the pixel data.

Definition at line 409 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::begin().

◆ cend()

template<typename TImage >
const_iterator itk::Experimental::ImageRegionRange< TImage >::cend ( ) const
inlinenoexcept

Returns a const 'end iterator' for this range.

Definition at line 416 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::end().

◆ ComputeOffset()

template<typename TImage >
static OffsetValueType itk::Experimental::ImageRegionRange< TImage >::ComputeOffset ( const OffsetTableType offsetTable,
const IndexType bufferedRegionIndex,
const IndexType index 
)
inlinestaticprivate

◆ crbegin()

template<typename TImage >
const_reverse_iterator itk::Experimental::ImageRegionRange< TImage >::crbegin ( ) const
inlinenoexcept

Returns a const reverse 'begin iterator' for this range.

Definition at line 439 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::rbegin().

◆ crend()

template<typename TImage >
const_reverse_iterator itk::Experimental::ImageRegionRange< TImage >::crend ( ) const
inlinenoexcept

Returns a const reverse 'end iterator' for this range.

Definition at line 446 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::rend().

◆ empty()

template<typename TImage >
bool itk::Experimental::ImageRegionRange< TImage >::empty ( ) const
inlinenoexcept

Tells whether the range is empty.

Definition at line 464 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::m_IterationRegionSize.

◆ end()

template<typename TImage >
iterator itk::Experimental::ImageRegionRange< TImage >::end ( ) const
inlinenoexcept

◆ rbegin()

template<typename TImage >
reverse_iterator itk::Experimental::ImageRegionRange< TImage >::rbegin ( ) const
inlinenoexcept

Returns a reverse 'begin iterator' for this range.

Definition at line 423 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::end().

Referenced by itk::Experimental::ImageRegionRange< TImage >::crbegin().

◆ rend()

template<typename TImage >
reverse_iterator itk::Experimental::ImageRegionRange< TImage >::rend ( ) const
inlinenoexcept

Returns a reverse 'end iterator' for this range.

Definition at line 431 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::begin().

Referenced by itk::Experimental::ImageRegionRange< TImage >::crend().

◆ size()

template<typename TImage >
std::vcl_size_t itk::Experimental::ImageRegionRange< TImage >::size ( ) const
inlinenoexcept

Returns the size of the range, that is the number of pixels in the region.

Definition at line 454 of file itkImageRegionRange.h.

References itk::Experimental::ImageRegionRange< TImage >::m_IterationRegionSize.

Member Data Documentation

◆ ImageDimension

template<typename TImage >
constexpr ImageDimensionType itk::Experimental::ImageRegionRange< TImage >::ImageDimension = TImage::ImageDimension
staticconstexprprivate

◆ IsImageTypeConst

template<typename TImage >
constexpr bool itk::Experimental::ImageRegionRange< TImage >::IsImageTypeConst = std::is_const<TImage>::value
staticconstexprprivate

Definition at line 81 of file itkImageRegionRange.h.

◆ m_BufferBegin

template<typename TImage >
BufferIteratorType itk::Experimental::ImageRegionRange< TImage >::m_BufferBegin {}
private

◆ m_BufferedRegionIndex

template<typename TImage >
IndexType itk::Experimental::ImageRegionRange< TImage >::m_BufferedRegionIndex { {} }
private

◆ m_IterationRegionIndex

template<typename TImage >
IndexType itk::Experimental::ImageRegionRange< TImage >::m_IterationRegionIndex { {} }
private

◆ m_IterationRegionSize

template<typename TImage >
SizeType itk::Experimental::ImageRegionRange< TImage >::m_IterationRegionSize { {} }
private

◆ m_OffsetTable

template<typename TImage >
OffsetTableType itk::Experimental::ImageRegionRange< TImage >::m_OffsetTable { {} }
private

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