ITK
6.0.0
Insight Toolkit
|
#include <itkConnectedImageNeighborhoodShape.h>
Connected image-neighborhood shape, based on the topological property of pixel connectivity. Eases creating a sequence of offsets to construct a ShapedImageNeighborhoodRange object. Can also be used to specify the shape of a ShapedNeighborhoodIterator, using its ActivateOffset member function.
This shape class supports generating offsets in colexicographic order. Which means that, for example, a sequence of generated offsets for a 2-dimensional shape will have offset {1, 0} before offset {0, 1}. This order was chosen because it is usually in agreement with the order of the corresponding neighbor pixels, as stored in the internal image buffer.
The following example generates the offsets for a 3-dimensional 18-connected neighborhood shape, including the center pixel, and asserts that the result is as expected:
The following code shows how to create 4-connected, 8-connected, 6-connected, 18-connected, and 26-connected neighborhood shapes:
Definition at line 87 of file itkConnectedImageNeighborhoodShape.h.
Public Member Functions | |
constexpr vcl_size_t | GetNumberOfOffsets () const noexcept |
constexpr | ConnectedImageNeighborhoodShape (const vcl_size_t maximumCityblockDistance, const bool includeCenterPixel) noexcept |
void | FillOffsets (Offset< ImageDimension > *const offsets) const noexcept |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = VImageDimension |
Static Private Member Functions | |
static constexpr uintmax_t | CalculateBinomialCoefficient (const uintmax_t n, const uintmax_t k) noexcept |
static constexpr vcl_size_t | CalculateNumberOfConnectedNeighbors (const vcl_size_t maximumCityblockDistance) noexcept |
static constexpr vcl_size_t | CalculateNumberOfHypercubesOnBoundaryOfCube (const vcl_size_t m, const vcl_size_t n) noexcept |
static constexpr uintmax_t | CalculatePowerOfTwo (const vcl_size_t n) noexcept |
static constexpr uintmax_t | CalculateSum (const uintmax_t a, const uintmax_t b) noexcept |
static constexpr vcl_size_t | CalculateSumOfNumberOfHypercubesOnBoundaryOfCube (const vcl_size_t i, const vcl_size_t m) noexcept |
static constexpr vcl_size_t | CalculateNumberOfOffsets (const vcl_size_t maximumCityblockDistance, const bool includeCenterPixel) noexcept |
Private Attributes | |
bool | m_IncludeCenterPixel |
vcl_size_t | m_MaximumCityblockDistance |
vcl_size_t | m_NumberOfOffsets |
|
inlineexplicitconstexprnoexcept |
Constructs a connected image-neighborhood shape. Its offsets contain only the offset values -1, 0, and 1. The parameter 'maximumCityblockDistance' specifies the maximum city-block distance (Manhattan distance) between the center pixel and the connected neighbor pixel. This distance measure corresponds to the number of non-zero values of an offset. For example, in a 3-dimensional neighborhood, offset {1,0,0}, {0,1,0}, and {0,0,1} have distance = 1 to the center, while offset {1,1,1} has distance = 3. The parameter 'includeCenterPixel' specifies whether or not the center pixel (offset zero) should be included with the offsets for this shape.
Definition at line 104 of file itkConnectedImageNeighborhoodShape.h.
|
inlinestaticconstexprprivatenoexcept |
Definition at line 200 of file itkConnectedImageNeighborhoodShape.h.
References itk::Math::UnsignedProduct().
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
Calculates the number of neighbors connected to the center pixel.
Definition at line 236 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension, and itk::Math::UnsignedPower().
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfOffsets().
|
inlinestaticconstexprprivatenoexcept |
Definition at line 212 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateBinomialCoefficient(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculatePowerOfTwo(), and itk::Math::UnsignedProduct().
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
Calculates the number of offsets needed for this shape.
Definition at line 249 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors().
|
inlinestaticconstexprprivatenoexcept |
Definition at line 188 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
Definition at line 179 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
Definition at line 227 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSum(), and itk::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors().
|
inlinenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 123 of file itkConnectedImageNeighborhoodShape.h.
References itk::Offset< VDimension >::begin(), itk::Offset< VDimension >::end(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension, itk::ConnectedImageNeighborhoodShape< VImageDimension >::m_IncludeCenterPixel, itk::ConnectedImageNeighborhoodShape< VImageDimension >::m_MaximumCityblockDistance, and itk::ConnectedImageNeighborhoodShape< VImageDimension >::m_NumberOfOffsets.
|
inlineconstexprnoexcept |
Returns the number of offsets needed for this shape.
Definition at line 115 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::m_NumberOfOffsets.
Referenced by itk::GenerateConnectedImageNeighborhoodShapeOffsets().
|
staticconstexpr |
Definition at line 90 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(), and itk::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
Definition at line 170 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
Definition at line 166 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
Definition at line 173 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets(), and itk::ConnectedImageNeighborhoodShape< VImageDimension >::GetNumberOfOffsets().