ITK
5.2.0
Insight Toolkit
|
#include <itkConnectedImageNeighborhoodShape.h>
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = VImageDimension |
std::vcl_size_t | m_MaximumCityblockDistance |
bool | m_IncludeCenterPixel |
std::vcl_size_t | m_NumberOfOffsets |
constexpr | ConnectedImageNeighborhoodShape (const std::vcl_size_t maximumCityblockDistance, const bool includeCenterPixel) noexcept |
constexpr std::vcl_size_t | GetNumberOfOffsets () const noexcept |
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 | CalculatePowerOfTwo (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 |
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.
|
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 116 of file itkConnectedImageNeighborhoodShape.h.
|
inlinestaticconstexprprivatenoexcept |
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 212 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT, and itk::Math::UnsignedProduct().
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
Calculates the number of neighbors connected to the center pixel.
Definition at line 248 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension, and itk::Math::UnsignedPower().
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfOffsets().
|
inlinestaticconstexprprivatenoexcept |
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 223 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateBinomialCoefficient(), itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculatePowerOfTwo(), and itk::Math::UnsignedProduct().
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
Calculates the number of offsets needed for this shape.
Definition at line 261 of file itkConnectedImageNeighborhoodShape.h.
References itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors().
|
inlinestaticconstexprprivatenoexcept |
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 200 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
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 191 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
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 238 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 135 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.
|
inlineconstexprnoexcept |
Returns the number of offsets needed for this shape.
Definition at line 127 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 281 of file itkConnectedImageNeighborhoodShape.h.
|
staticconstexpr |
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 |
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 182 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
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 178 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets().
|
private |
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 185 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets(), and itk::Experimental::ConnectedImageNeighborhoodShape< VImageDimension >::GetNumberOfOffsets().