ITK
5.0.0
Insight Segmentation and Registration 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 99 of file itkConnectedImageNeighborhoodShape.h.
Public Member Functions | |
constexpr std::vcl_size_t | GetNumberOfOffsets () const noexcept |
constexpr | ConnectedImageNeighborhoodShape (const std::vcl_size_t maximumCityblockDistance, const bool includeCenterPixel) noexcept |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = VImageDimension |
std::vcl_size_t | m_MaximumCityblockDistance |
bool | m_IncludeCenterPixel |
std::vcl_size_t | m_NumberOfOffsets |
void | FillOffsets (Offset< ImageDimension > *const offsets) const noexcept |
static constexpr std::uintmax_t | CalculateSum (const std::uintmax_t a, const std::uintmax_t b) noexcept |
static constexpr std::uintmax_t | CalculateProduct (const std::uintmax_t a, const std::uintmax_t b) noexcept |
static constexpr std::uintmax_t | CalculatePowerOfTwo (const std::vcl_size_t n) noexcept |
static constexpr std::uintmax_t | CalculatePowerOfThree (const std::vcl_size_t n) noexcept |
static constexpr std::uintmax_t | CalculateBinomialCoefficient (const std::uintmax_t n, const std::uintmax_t k) noexcept |
static constexpr std::vcl_size_t | CalculateNumberOfHypercubesOnBoundaryOfCube (const std::vcl_size_t m, const std::vcl_size_t n) noexcept |
static constexpr std::vcl_size_t | CalculateSumOfNumberOfHypercubesOnBoundaryOfCube (const std::vcl_size_t i, const std::vcl_size_t m) noexcept |
static constexpr std::vcl_size_t | CalculateNumberOfConnectedNeighbors (const std::vcl_size_t maximumCityblockDistance) noexcept |
static constexpr std::vcl_size_t | CalculateNumberOfOffsets (const std::vcl_size_t maximumCityblockDistance, const bool includeCenterPixel) noexcept |
template<unsigned int VImageDimensionOfFriend, std::vcl_size_t VMaximumCityblockDistance, bool VIncludeCenterPixel> | |
std::array< Offset < VImageDimensionOfFriend > , ConnectedImageNeighborhoodShape < VImageDimensionOfFriend > ::CalculateNumberOfOffsets(VMaximumCityblockDistance, VIncludeCenterPixel)> | GenerateConnectedImageNeighborhoodShapeOffsets () noexcept |
|
inlineexplicitnoexcept |
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 116 of file itkConnectedImageNeighborhoodShape.h.
|
inlinestaticprivatenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 236 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateProduct(), and ITK_X_ASSERT.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticprivatenoexcept |
Calculates the number of neighbors connected to the center pixel.
Definition at line 278 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculatePowerOfThree(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(), and itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfOffsets().
|
inlinestaticprivatenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 250 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateBinomialCoefficient(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculatePowerOfTwo(), and itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateProduct().
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticprivatenoexcept |
Calculates the number of offsets needed for this shape.
Definition at line 288 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors().
|
inlinestaticprivatenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 224 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateProduct().
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors().
|
inlinestaticprivatenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 214 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticprivatenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 203 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateBinomialCoefficient(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube(), and itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculatePowerOfThree().
|
inlinestaticprivatenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 192 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticprivatenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 267 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSum(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension, and ITK_X_ASSERT.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors().
|
inlinenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 136 of file itkConnectedImageNeighborhoodShape.h.
References itk::Offset< VDimension >::begin(), itk::Offset< VDimension >::end(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension, itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::m_IncludeCenterPixel, itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::m_MaximumCityblockDistance, and itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::m_NumberOfOffsets.
|
inlinenoexcept |
Returns the number of offsets needed for this shape.
Definition at line 129 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::m_NumberOfOffsets.
Referenced by itk::Experimental::GenerateConnectedImageNeighborhoodShapeOffsets().
|
friend |
Generates the offsets for a connected image neighborhood shape.
Definition at line 311 of file itkConnectedImageNeighborhoodShape.h.
|
static |
Definition at line 102 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(), and itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 184 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 180 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 187 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets(), and itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::GetNumberOfOffsets().