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 97 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 114 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 210 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT, and itk::Math::UnsignedProduct().
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube().
|
inlinestaticconstexprprivatenoexcept |
Calculates the number of neighbors connected to the center pixel.
Definition at line 246 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension, and itk::Math::UnsignedPower().
Referenced by itk::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 221 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 259 of file itkConnectedImageNeighborhoodShape.h.
References itk::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 198 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT.
Referenced by itk::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 189 of file itkConnectedImageNeighborhoodShape.h.
References ITK_X_ASSERT.
Referenced by itk::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 236 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfHypercubesOnBoundaryOfCube(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSum(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::ImageDimension, and ITK_X_ASSERT.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors().
|
inlinenoexcept |
Fills the specified buffer with the offsets for a neighborhood of this shape.
Definition at line 133 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 125 of file itkConnectedImageNeighborhoodShape.h.
References itk::ConnectedImageNeighborhoodShape< VImageDimension >::m_NumberOfOffsets.
Referenced by itk::GenerateConnectedImageNeighborhoodShapeOffsets().
|
friend |
Generates the offsets for a connected image neighborhood shape.
Definition at line 279 of file itkConnectedImageNeighborhoodShape.h.
|
staticconstexpr |
Definition at line 100 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateNumberOfConnectedNeighbors(), itk::ConnectedImageNeighborhoodShape< VImageDimension >::CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(), and itk::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 180 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::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 176 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::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 183 of file itkConnectedImageNeighborhoodShape.h.
Referenced by itk::ConnectedImageNeighborhoodShape< VImageDimension >::FillOffsets(), and itk::ConnectedImageNeighborhoodShape< VImageDimension >::GetNumberOfOffsets().