ITK
5.2.0
Insight Toolkit
|
#include <itkIndexRange.h>
Classes | |
class | const_iterator |
Public Types | |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
using | IndexType = Index< VDimension > |
using | iterator = const_iterator |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | SizeType = Size< VDimension > |
Public Member Functions | |
IndexRange ()=default | |
IndexRange (const SizeType &gridSize) | |
Static Public Attributes | |
constexpr static unsigned | Dimension = VDimension |
using | MinIndexType = typename iterator::MinIndexType |
MinIndexType | m_MinIndex = MinIndexType() |
IndexType | m_MaxIndex = IndexType::Filled(-1) |
template<bool VIsSubstitutionFailure = VBeginAtZero, typename TVoid = typename std::enable_if<!VIsSubstitutionFailure>::type> | |
IndexRange (const ImageRegion< VDimension > &imageRegion) | |
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 |
static IndexType | CalculateMaxIndex (const MinIndexType &minIndex, const SizeType &size) |
Modern C++11 range, supporting efficient iteration over the indices of an image grid space.
The following example prints all indices of an 2-D grid space of size 2x3.
The indices from IndexRange can also be used as consecutive locations of a ShapedImageNeighborhoodRange, for example:
IndexRange is designed to conform to Standard C++ Iterator requirements, so that it can be used in range-based for loop, and its iterators can be passed to Standard C++ algorithms.
Definition at line 80 of file itkIndexRange.h.
using itk::Experimental::IndexRange< VDimension, VBeginAtZero >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 295 of file itkIndexRange.h.
using itk::Experimental::IndexRange< VDimension, VBeginAtZero >::IndexType = Index<VDimension> |
Definition at line 85 of file itkIndexRange.h.
using itk::Experimental::IndexRange< VDimension, VBeginAtZero >::iterator = const_iterator |
Definition at line 293 of file itkIndexRange.h.
|
private |
Constructs a range of indices for the specified image region.
Definition at line 425 of file itkIndexRange.h.
using itk::Experimental::IndexRange< VDimension, VBeginAtZero >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 294 of file itkIndexRange.h.
using itk::Experimental::IndexRange< VDimension, VBeginAtZero >::SizeType = Size<VDimension> |
Definition at line 84 of file itkIndexRange.h.
|
default |
Explicitly defaulted default-constructor. Constructs an empty range.
|
inlineexplicit |
Constructs a range of indices for the specified grid size.
Definition at line 307 of file itkIndexRange.h.
|
inlineexplicit |
Constructs a range of indices for the specified image region.
Definition at line 321 of file itkIndexRange.h.
|
inlinenoexcept |
Returns an iterator to the first index.
Definition at line 339 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MaxIndex, and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MinIndex.
Referenced by itk::Experimental::IndexRange< VDimension, VBeginAtZero >::cbegin(), and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::rend().
|
inlinestaticprivate |
Constructs a range of indices for the specified image region.
Definition at line 428 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::size().
|
inlinenoexcept |
Returns a const iterator to the first index. Provides only read-only access to the index data.
Definition at line 357 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::begin().
|
inlinenoexcept |
Returns a const 'end iterator' for this range.
Definition at line 364 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::end().
|
inlinenoexcept |
Returns a const reverse 'begin iterator' for this range.
Definition at line 385 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::rbegin().
|
inlinenoexcept |
Returns a const reverse 'end iterator' for this range.
Definition at line 392 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::rend().
|
inlinenoexcept |
Tells whether the range is empty.
Definition at line 414 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MaxIndex, and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MinIndex.
|
inlinenoexcept |
Returns an 'end iterator' for this range.
Definition at line 346 of file itkIndexRange.h.
References itk::Index< VDimension >::back(), itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MaxIndex, and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MinIndex.
Referenced by itk::Experimental::IndexRange< VDimension, VBeginAtZero >::cend(), and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::rbegin().
|
inlinenoexcept |
Returns a reverse 'begin iterator' for this range.
Definition at line 371 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::end().
Referenced by itk::Experimental::IndexRange< VDimension, VBeginAtZero >::crbegin().
|
inlinenoexcept |
Returns a reverse 'end iterator' for this range.
Definition at line 378 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::begin().
Referenced by itk::Experimental::IndexRange< VDimension, VBeginAtZero >::crend().
|
inlinenoexcept |
Returns the size of the range, that is the number of indices.
Definition at line 400 of file itkIndexRange.h.
References itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MaxIndex, and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::m_MinIndex.
Referenced by itk::Experimental::IndexRange< VDimension, VBeginAtZero >::CalculateMaxIndex().
|
staticconstexpr |
Definition at line 83 of file itkIndexRange.h.
|
private |
Constructs a range of indices for the specified image region.
Definition at line 460 of file itkIndexRange.h.
Referenced by itk::Experimental::IndexRange< VDimension, VBeginAtZero >::begin(), itk::Experimental::IndexRange< VDimension, VBeginAtZero >::empty(), itk::Experimental::IndexRange< VDimension, VBeginAtZero >::end(), and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::size().
|
private |
Constructs a range of indices for the specified image region.
Definition at line 457 of file itkIndexRange.h.
Referenced by itk::Experimental::IndexRange< VDimension, VBeginAtZero >::begin(), itk::Experimental::IndexRange< VDimension, VBeginAtZero >::empty(), itk::Experimental::IndexRange< VDimension, VBeginAtZero >::end(), and itk::Experimental::IndexRange< VDimension, VBeginAtZero >::size().