#include <itkNeighborhood.h>
A light-weight container object for storing an N-dimensional neighborhood of values.
This class serves as the base class for several other Itk objects such as itk::NeighborhoodOperator and itk::NeighborhoodIterator. Its purpose is to store values and their relative spatial locations.
A Neighborhood has an N-dimensional radius. The radius is defined separately for each dimension as the number of pixels that the neighborhood extends outward from the center pixel. For example, a 2D Neighborhood object with a radius of 2x3 has sides of length 5x7. Neighborhood objects always have an unambiguous center because their side lengths are always odd.
Definition at line 54 of file itkNeighborhood.h.
Public Types | |
using | AllocatorType = TAllocator |
using | ConstIterator = typename AllocatorType::const_iterator |
using | DimensionValueType = unsigned int |
using | Iterator = typename AllocatorType::iterator |
using | NeighborIndexType = SizeValueType |
using | OffsetType = Offset<VDimension> |
using | PixelType = TPixel |
using | RadiusType = itk::Size<VDimension> |
using | Self = Neighborhood |
using | SizeType = itk::Size<VDimension> |
using | SizeValueType = typename SizeType::SizeValueType |
using | SliceIteratorType = SliceIterator<TPixel, Self> |
Static Public Attributes | |
static constexpr unsigned int | NeighborhoodDimension = VDimension |
Protected Member Functions | |
virtual void | Allocate (NeighborIndexType i) |
virtual void | ComputeNeighborhoodOffsetTable () |
virtual void | ComputeNeighborhoodStrideTable () |
virtual void | PrintSelf (std::ostream &, Indent) const |
void | SetSize () |
Private Attributes | |
AllocatorType | m_DataBuffer {} |
std::vector< OffsetType > | m_OffsetTable {} |
SizeType | m_Radius { { 0 } } |
SizeType | m_Size { { 0 } } |
OffsetValueType | m_StrideTable [VDimension] { 0 } |
using itk::Neighborhood< TPixel, VDimension, TAllocator >::AllocatorType = TAllocator |
External support for allocator type.
Definition at line 61 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::ConstIterator = typename AllocatorType::const_iterator |
Definition at line 76 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::DimensionValueType = unsigned int |
Type used to refer to space dimensions
Definition at line 92 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::Iterator = typename AllocatorType::iterator |
Iterator type alias support Note the naming is intentional, i.e., AllocatorType::iterator and AllocatorType::const_iterator, because the allocator may be a vnl object or other type, which uses this form.
Definition at line 75 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::NeighborIndexType = SizeValueType |
Type used to refer to the elements of the pixel list that are part of the neighborhood.
Definition at line 96 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::OffsetType = Offset<VDimension> |
Offset type used to reference neighbor locations
Definition at line 86 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::PixelType = TPixel |
External support for pixel type.
Definition at line 70 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::RadiusType = itk::Size<VDimension> |
Radius type alias support
Definition at line 83 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::Self = Neighborhood |
Standard class type aliases.
Definition at line 58 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::SizeType = itk::Size<VDimension> |
Size and value type alias support
Definition at line 79 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::SizeValueType = typename SizeType::SizeValueType |
Definition at line 80 of file itkNeighborhood.h.
using itk::Neighborhood< TPixel, VDimension, TAllocator >::SliceIteratorType = SliceIterator<TPixel, Self> |
External slice iterator type alias support
Definition at line 89 of file itkNeighborhood.h.
|
default |
|
virtualdefault |
Default destructor.
|
default |
Copy constructor.
|
default |
Move-constructor.
|
inlineprotectedvirtual |
Allocates the neighborhood's memory buffer.
Definition at line 312 of file itkNeighborhood.h.
|
inline |
STL-style iterator support.
Definition at line 174 of file itkNeighborhood.h.
|
inline |
STL-style iterator support.
Definition at line 184 of file itkNeighborhood.h.
|
protectedvirtual |
Fills entries into the offset lookup table. Called once on initialization.
|
protectedvirtual |
Computes the entries for the stride table
|
inline |
STL-style iterator support.
Definition at line 169 of file itkNeighborhood.h.
|
inline |
STL-style iterator support.
Definition at line 179 of file itkNeighborhood.h.
|
inline |
Returns a reference to the data buffer structure.
Definition at line 254 of file itkNeighborhood.h.
Referenced by itk::operator<<().
|
inline |
Returns a reference to the data buffer structure.
Definition at line 259 of file itkNeighborhood.h.
|
inline |
Definition at line 291 of file itkNeighborhood.h.
|
inline |
Returns the element at the center of the neighborhood.
Definition at line 218 of file itkNeighborhood.h.
|
inline |
Pass-through data access methods to the buffer.
Definition at line 210 of file itkNeighborhood.h.
|
virtual |
Reimplemented in itk::AnnulusOperator< TPixel, TDimension, TAllocator >, itk::BackwardDifferenceOperator< TPixel, TDimension, TAllocator >, itk::DerivativeOperator< TPixel, VDimension, TAllocator >, itk::DerivativeOperator< OutputImagePixelType, Self::ImageDimension >, itk::DerivativeOperator< PixelType, Self::ImageDimension >, itk::DerivativeOperator< ScalarValueType, Self::ImageDimension >, itk::DerivativeOperator< TPixel, VDimension, TAllocator >, itk::DerivativeOperator< TPixel, VDimension, TAllocator >, itk::ForwardDifferenceOperator< TPixel, VDimension, TAllocator >, itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >, itk::GaussianDerivativeOperator< TOutput, Self::ImageDimension2 >, itk::GaussianDerivativeOperator< TOutput, Self::ImageDimension2 >, itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::GaussianOperator< RealOutputPixelValueType, ImageDimension >, itk::GaussianOperator< RealOutputPixelValueType, ImageDimension >, itk::GaussianOperator< ScalarType, Superclass::Dimension >, itk::GaussianOperator< ScalarType, Superclass::Dimension >, itk::GaussianOperator< ScalarType, VDimension >, itk::GaussianOperator< ScalarType, VDimension >, itk::GaussianOperator< TOutput, Self::ImageDimension >, itk::GaussianOperator< TOutput, Self::ImageDimension >, itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::ImageKernelOperator< TPixel, VDimension, TAllocator >, itk::LaplacianOperator< TPixel, VDimension, TAllocator >, itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >, itk::NeighborhoodOperator< FixedGradientPixelType, VDimension, NeighborhoodAllocator< FixedGradientPixelType > >, itk::NeighborhoodOperator< MovedGradientPixelType, VDimension, NeighborhoodAllocator< MovedGradientPixelType > >, itk::NeighborhoodOperator< OutputImagePixelType, VDimension, NeighborhoodAllocator< OutputImagePixelType > >, itk::NeighborhoodOperator< PixelType, VDimension, NeighborhoodAllocator< PixelType > >, itk::NeighborhoodOperator< ScalarValueType, VDimension, NeighborhoodAllocator< ScalarValueType > >, itk::NeighborhoodOperator< TPixel, 2, NeighborhoodAllocator< TPixel > >, itk::NeighborhoodOperator< TPixel, TDimension, TAllocator >, itk::NeighborhoodOperator< TPixel, TDimension, TAllocator >, itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >, itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< FixedGradientPixelType, Self::FixedImageDimension >, and itk::SobelOperator< MovedGradientPixelType, Self::MovedImageDimension >.
|
virtual |
|
inline |
Returns the itk::Offset from the center of the Neighborhood to the requested neighbor index.
Definition at line 282 of file itkNeighborhood.h.
|
inline |
Returns the radius of the neighborhood.
Definition at line 129 of file itkNeighborhood.h.
Referenced by itk::operator<<().
|
inline |
Returns the radius of the neighborhood along a specified dimension.
Definition at line 137 of file itkNeighborhood.h.
|
inline |
Returns the size (total length of sides) of the neighborhood.
Definition at line 152 of file itkNeighborhood.h.
|
inline |
Returns the size (total length) of the neighborhood along a specified dimension.
Definition at line 145 of file itkNeighborhood.h.
Referenced by itk::operator<<().
std::slice itk::Neighborhood< TPixel, VDimension, TAllocator >::GetSlice | ( | unsigned int | ) | const |
|
inline |
Returns the stride length for the specified dimension. Stride length is the number of pixels between adjacent pixels along the given dimension.
Definition at line 161 of file itkNeighborhood.h.
Referenced by itk::RegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData >::Initialize().
itk::Neighborhood< TPixel, VDimension, TAllocator >::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION | ( | Self | ) |
|
default |
Assignment operator.
|
default |
Move-assignment.
|
inline |
Comparison operator.
Definition at line 120 of file itkNeighborhood.h.
|
inline |
Get pixel value by offset
Definition at line 268 of file itkNeighborhood.h.
|
inline |
Get pixel value by offset
Definition at line 273 of file itkNeighborhood.h.
|
inline |
Pass-through data access methods to the buffer.
Definition at line 200 of file itkNeighborhood.h.
|
inline |
Pass-through data access methods to the buffer.
Definition at line 205 of file itkNeighborhood.h.
|
inline |
Standard itk object method.
Definition at line 246 of file itkNeighborhood.h.
|
protectedvirtual |
Standard itk object method.
Reimplemented in itk::AnnulusOperator< TPixel, TDimension, TAllocator >, itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >, itk::ConstNeighborhoodIterator< FixedImageType >, itk::ConstNeighborhoodIterator< FixedImageType >, itk::ConstNeighborhoodIterator< Image< float, 2 > >, itk::ConstNeighborhoodIterator< Image< float, 2 > >, itk::ConstNeighborhoodIterator< ImageType >, itk::ConstNeighborhoodIterator< ImageType >, itk::ConstNeighborhoodIterator< ImageType, TBoundaryCondition >, itk::ConstNeighborhoodIterator< ImageType, TBoundaryCondition >, itk::ConstNeighborhoodIterator< ImageType, ZeroFluxNeumannBoundaryCondition< ImageType > >, itk::ConstNeighborhoodIterator< InputImageType >, itk::ConstNeighborhoodIterator< InputImageType >, itk::ConstNeighborhoodIterator< InputImageType, BoundaryConditionType >, itk::ConstNeighborhoodIterator< InputImageType, BoundaryConditionType >, itk::ConstNeighborhoodIterator< InputImageType, DefaultBoundaryConditionType >, itk::ConstNeighborhoodIterator< InputImageType, DefaultBoundaryConditionType >, itk::ConstNeighborhoodIterator< OutputImageType, DefaultBoundaryConditionType >, itk::ConstNeighborhoodIterator< OutputImageType, DefaultBoundaryConditionType >, itk::ConstNeighborhoodIterator< RealVectorImageType >, itk::ConstNeighborhoodIterator< RealVectorImageType >, itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >, itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >, itk::ConstNeighborhoodIterator< TImage, ZeroFluxNeumannBoundaryCondition< TImage > >, itk::ConstNeighborhoodIterator< TImageType >, itk::ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType >, itk::ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType >, itk::ConstNeighborhoodIterator< TInputImage >, itk::ConstNeighborhoodIterator< TInputImage >, itk::ConstNeighborhoodIterator< VirtualImageType >, itk::ConstNeighborhoodIterator< VirtualImageType >, itk::ConstNeighborhoodIteratorWithOnlyIndex< TImage >, itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >, itk::ConstShapedNeighborhoodIterator< ImageType, ZeroFluxNeumannBoundaryCondition< ImageType > >, itk::ConstShapedNeighborhoodIterator< InputImageType >, itk::ConstShapedNeighborhoodIterator< InputImageType >, itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >, itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >, itk::ConstShapedNeighborhoodIterator< TImage, ZeroFluxNeumannBoundaryCondition< TImage > >, itk::DerivativeOperator< TPixel, VDimension, TAllocator >, itk::DerivativeOperator< OutputImagePixelType, Self::ImageDimension >, itk::DerivativeOperator< PixelType, Self::ImageDimension >, itk::DerivativeOperator< ScalarValueType, Self::ImageDimension >, itk::DerivativeOperator< TPixel, VDimension, TAllocator >, itk::DerivativeOperator< TPixel, VDimension, TAllocator >, itk::FlatStructuringElement< VDimension >, itk::FlatStructuringElement< Self::ImageDimension >, itk::FlatStructuringElement< Self::ImageDimension >, itk::FlatStructuringElement< TInputImage::ImageDimension >, itk::FlatStructuringElement<(Self::ImageDimension)>, itk::FlatStructuringElement<(Self::ImageDimension)>, itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >, itk::GaussianDerivativeOperator< TOutput, Self::ImageDimension2 >, itk::GaussianDerivativeOperator< TOutput, Self::ImageDimension2 >, itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::GaussianOperator< RealOutputPixelValueType, ImageDimension >, itk::GaussianOperator< RealOutputPixelValueType, ImageDimension >, itk::GaussianOperator< ScalarType, Superclass::Dimension >, itk::GaussianOperator< ScalarType, Superclass::Dimension >, itk::GaussianOperator< ScalarType, VDimension >, itk::GaussianOperator< ScalarType, VDimension >, itk::GaussianOperator< TOutput, Self::ImageDimension >, itk::GaussianOperator< TOutput, Self::ImageDimension >, itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::ImageKernelOperator< TPixel, VDimension, TAllocator >, itk::LaplacianOperator< TPixel, VDimension, TAllocator >, itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >, itk::NeighborhoodOperator< FixedGradientPixelType, VDimension, NeighborhoodAllocator< FixedGradientPixelType > >, itk::NeighborhoodOperator< MovedGradientPixelType, VDimension, NeighborhoodAllocator< MovedGradientPixelType > >, itk::NeighborhoodOperator< OutputImagePixelType, VDimension, NeighborhoodAllocator< OutputImagePixelType > >, itk::NeighborhoodOperator< PixelType, VDimension, NeighborhoodAllocator< PixelType > >, itk::NeighborhoodOperator< ScalarValueType, VDimension, NeighborhoodAllocator< ScalarValueType > >, itk::NeighborhoodOperator< TPixel, 2, NeighborhoodAllocator< TPixel > >, itk::NeighborhoodOperator< TPixel, TDimension, TAllocator >, itk::NeighborhoodOperator< TPixel, TDimension, TAllocator >, itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >, and itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >.
void itk::Neighborhood< TPixel, VDimension, TAllocator >::SetRadius | ( | const SizeType & | ) |
Sets the radius for the neighborhood, calculates size from the radius, and allocates storage.
Referenced by itk::BinaryCrossStructuringElement< TPixel, VDimension, TAllocator >::BinaryCrossStructuringElement(), and itk::RegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData >::Initialize().
|
inline |
Sets the radius for the neighborhood. Overloaded to support an unsigned long array.
Definition at line 231 of file itkNeighborhood.h.
void itk::Neighborhood< TPixel, VDimension, TAllocator >::SetRadius | ( | const SizeValueType | ) |
Overloads SetRadius to allow a single long integer argument that is used as the radius of all the dimensions of the Neighborhood (resulting in a "square" neighborhood).
|
inlineprotected |
Sets the length along each dimension.
Definition at line 302 of file itkNeighborhood.h.
|
inline |
More STL-style support.
Definition at line 192 of file itkNeighborhood.h.
Referenced by itk::RegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData >::Initialize(), and itk::VectorNeighborhoodInnerProduct< TImage >::operator()().
|
private |
The buffer in which data is stored.
Definition at line 340 of file itkNeighborhood.h.
Referenced by itk::Neighborhood< InternalPixelType *, Self::Dimension >::operator==().
|
private |
Definition at line 347 of file itkNeighborhood.h.
|
private |
Number of neighbors to include (symmetrically) along each axis. A neighborhood will always have odd-length axes (m_Radius[n]*2+1).
Definition at line 333 of file itkNeighborhood.h.
Referenced by itk::Neighborhood< InternalPixelType *, Self::Dimension >::operator==().
|
private |
Actual length of each dimension, calculated from m_Radius. A neighborhood will always have odd-length axes (m_Radius[n]*2+1).
Definition at line 337 of file itkNeighborhood.h.
Referenced by itk::Neighborhood< InternalPixelType *, Self::Dimension >::operator==().
|
private |
A lookup table for keeping track of stride lengths in a neighborhood i.e. the memory offsets between pixels along each dimensional axis
Definition at line 344 of file itkNeighborhood.h.
|
staticconstexpr |
External support for dimensionality.
Definition at line 64 of file itkNeighborhood.h.