ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkShapedImageNeighborhoodRange.h>
Modern C++11 range to iterate over a neighborhood of pixels. 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 creates a 3 x 5 neighborhood around pixel [10, 20] and adds 42 to each neighborhood pixel, using a range-based for loop:
The following example prints the values of the neighborhood pixels:
The inner product of the neighborhood with a kernel can be produced with std::inner_product (from the Standard C++ header "numeric"), as follows:
Definition at line 94 of file itkShapedImageNeighborhoodRange.h.
Classes | |
class | CheckPolicy |
struct | EmptyPixelAccessParameter |
struct | OptionalPixelAccessParameter |
struct | OptionalPixelAccessParameter< TPolicy, false > |
class | PixelProxy |
class | PixelProxy< false, TDummy > |
class | PixelProxy< true, TDummy > |
class | QualifiedIterator |
struct | RegionData |
Public Types | |
using | const_iterator = QualifiedIterator< true > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
using | iterator = QualifiedIterator< false > |
using | reverse_iterator = std::reverse_iterator< iterator > |
Public Member Functions | |
iterator | begin () const noexcept |
const_iterator | cbegin () const noexcept |
const_iterator | cend () const noexcept |
const_reverse_iterator | crbegin () const noexcept |
const_reverse_iterator | crend () const noexcept |
bool | empty () const noexcept |
iterator | end () const noexcept |
reverse_iterator | rbegin () const noexcept |
reverse_iterator | rend () const noexcept |
ShapedImageNeighborhoodRange ()=default | |
std::vcl_size_t | size () const noexcept |
ShapedImageNeighborhoodRange (ImageType &image, const IndexType &location, const OffsetType *const shapeOffsets, const std::vcl_size_t numberOfNeigborhoodPixels, const OptionalPixelAccessParameterType optionalPixelAccessParameter={}) | |
template<typename TContainerOfOffsets > | |
ShapedImageNeighborhoodRange (ImageType &image, const IndexType &location, const TContainerOfOffsets &shapeOffsets, const OptionalPixelAccessParameterType optionalPixelAccessParameter={}) | |
QualifiedIterator< false > ::reference | operator[] (const std::vcl_size_t n) const noexcept |
void | SetLocation (const IndexType &location) noexcept |
Private Types | |
using | ImageDimensionType = typename TImage::ImageDimensionType |
using | ImageRegionType = typename TImage::RegionType |
using | ImageSizeType = typename TImage::SizeType |
using | ImageSizeValueType = typename TImage::SizeValueType |
using | ImageType = TImage |
using | IndexType = typename TImage::IndexType |
using | IndexValueType = typename TImage::IndexValueType |
using | InternalPixelType = typename TImage::InternalPixelType |
using | NeighborhoodAccessorFunctorType = typename TImage::NeighborhoodAccessorFunctorType |
using | OffsetType = Offset< ImageDimension > |
using | OptionalPixelAccessParameterType = typename OptionalPixelAccessParameter< TImageNeighborhoodPixelAccessPolicy >::Type |
using | PixelType = typename TImage::PixelType |
using | QualifiedInternalPixelType = typename std::conditional< IsImageTypeConst, const InternalPixelType, InternalPixelType >::type |
Private Member Functions | |
void | SubtractIndex (IndexType &index1, const IndexType &index2) |
Private Attributes | |
RegionData | m_BufferedRegionData {} |
QualifiedInternalPixelType * | m_ImageBufferPointer { nullptr } |
NeighborhoodAccessorFunctorType | m_NeighborhoodAccessor {} |
std::vcl_size_t | m_NumberOfNeighborhoodPixels { 0 } |
OffsetType | m_OffsetTable {{}} |
OptionalPixelAccessParameterType | m_OptionalPixelAccessParameter {} |
IndexType | m_RelativeLocation {{}} |
const OffsetType * | m_ShapeOffsets { nullptr } |
Static Private Attributes | |
static constexpr ImageDimensionType | ImageDimension = TImage::ImageDimension |
static constexpr bool | IsImageTypeConst = std::is_const<TImage>::value |
using itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::const_iterator = QualifiedIterator<true> |
Definition at line 639 of file itkShapedImageNeighborhoodRange.h.
using itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 642 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 139 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 142 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 140 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 141 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 138 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 147 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 148 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 144 of file itkShapedImageNeighborhoodRange.h.
using itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::iterator = QualifiedIterator<false> |
Definition at line 640 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 145 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 149 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 151 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 143 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 584 of file itkShapedImageNeighborhoodRange.h.
using itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 641 of file itkShapedImageNeighborhoodRange.h.
|
default |
Explicitly-defaulted default-constructor. Constructs an empty range.
|
inline |
Specifies a range for the neighborhood of a pixel at the specified location. The shape of the neighborhood is specified by a pointer to a contiguous sequence of offsets, relative to the location index.
Definition at line 658 of file itkShapedImageNeighborhoodRange.h.
|
inline |
Specifies a range for the neighborhood of a pixel at the specified location. The shape of the neighborhood is specified by a container of offsets, relative to the location index. This container of offsets must be a contiguous container, for example std::vector<OffsetType> or std::array<OffsetType>.
Definition at line 696 of file itkShapedImageNeighborhoodRange.h.
|
inlinenoexcept |
Returns an iterator to the first neighborhood pixel.
Definition at line 715 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::m_BufferedRegionData, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_ImageBufferPointer, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_NeighborhoodAccessor, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_OffsetTable, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_OptionalPixelAccessParameter, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_RelativeLocation, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::m_ShapeOffsets, and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::RegionData::m_Size.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::cbegin(), itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::operator[](), and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::rend().
|
inlinenoexcept |
Returns a const iterator to the first neighborhood pixel. Provides only read-only access to the pixel data.
Definition at line 746 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::begin().
|
inlinenoexcept |
Returns a const 'end iterator' for this range.
Definition at line 752 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::end().
|
inlinenoexcept |
Returns a const reverse 'begin iterator' for this range.
Definition at line 770 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::rbegin().
|
inlinenoexcept |
Returns a const reverse 'end iterator' for this range.
Definition at line 776 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::rend().
|
inlinenoexcept |
Tells whether the range is empty.
Definition at line 790 of file itkShapedImageNeighborhoodRange.h.
|
inlinenoexcept |
Returns an 'end iterator' for this range.
Definition at line 730 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::m_BufferedRegionData, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_ImageBufferPointer, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_NeighborhoodAccessor, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::m_NumberOfNeighborhoodPixels, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_OffsetTable, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_OptionalPixelAccessParameter, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_RelativeLocation, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::m_ShapeOffsets, and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::RegionData::m_Size.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::cend(), and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::rbegin().
|
inlinenoexcept |
Subscript operator. Allows random access, to the nth neighbor pixel.
Definition at line 801 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::begin(), and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::size().
|
inlinenoexcept |
Returns a reverse 'begin iterator' for this range.
Definition at line 758 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::end().
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::crbegin().
|
inlinenoexcept |
Returns a reverse 'end iterator' for this range.
Definition at line 764 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::begin().
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::crend().
|
inlinenoexcept |
Sets the location of this neighborhood by specifying its pixel index. Typically, this is the index of the center pixel of the neighborhood.
Definition at line 814 of file itkShapedImageNeighborhoodRange.h.
References itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::m_BufferedRegionData, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::RegionData::m_Index, itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::QualifiedIterator< VIsConst >::m_RelativeLocation, and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::SubtractIndex().
|
inlinenoexcept |
Returns the size of the range, that is the number of neighborhood pixels.
Definition at line 783 of file itkShapedImageNeighborhoodRange.h.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::operator[]().
|
inlineprivate |
Definition at line 604 of file itkShapedImageNeighborhoodRange.h.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::SetLocation().
|
staticprivate |
Definition at line 146 of file itkShapedImageNeighborhoodRange.h.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::SubtractIndex().
|
staticprivate |
Definition at line 582 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 618 of file itkShapedImageNeighborhoodRange.h.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::begin(), itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::end(), and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::SetLocation().
|
private |
Definition at line 615 of file itkShapedImageNeighborhoodRange.h.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::PixelProxy< true, TDummy >::operator PixelType(), itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::PixelProxy< false, TDummy >::operator PixelType(), and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::PixelProxy< false, TDummy >::operator=().
|
private |
Definition at line 623 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 634 of file itkShapedImageNeighborhoodRange.h.
Referenced by itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::empty(), itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::end(), and itk::Experimental::ShapedImageNeighborhoodRange< TImage, TImageNeighborhoodPixelAccessPolicy >::size().
|
private |
Definition at line 621 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 636 of file itkShapedImageNeighborhoodRange.h.
|
private |
Definition at line 628 of file itkShapedImageNeighborhoodRange.h.
|
private |