19#ifndef itkConnectedImageNeighborhoodShape_h
20#define itkConnectedImageNeighborhoodShape_h
88template <
unsigned int VImageDimension>
106 const bool includeCenterPixel) noexcept
128 assert(offsets !=
nullptr);
137 const size_t numberOfNonZeroOffsetValues =
148 for (
unsigned int direction = 0; direction <
ImageDimension; ++direction)
150 auto & offsetValue = offset[direction];
154 if (offsetValue <= 1)
179 static constexpr uintmax_t
182 return ((a + b) >= a) && ((a + b) >= b) ? (a + b) : (assert(!
"CalculateSum overflow!"), 0);
188 static constexpr uintmax_t
191 return (n < std::numeric_limits<uintmax_t>::digits) ? (uintmax_t{ 1 } << n)
192 : (assert(!
"CalculatePowerOfTwo overflow!"), 0);
200 static constexpr uintmax_t
203 return (k > n) ? (assert(!
"Out of range!"), 0)
212 static constexpr size_t
227 static constexpr size_t
236 static constexpr size_t
239 return (((maximumCityblockDistance == 0) || (
ImageDimension == 0))
249 static constexpr size_t
258template <
unsigned int VImageDimension,
size_t VMaximumCityblockDistance,
bool VIncludeCenterPixel>
264 shape.FillOffsets(offsets.data());
static constexpr vcl_size_t CalculateNumberOfConnectedNeighbors(const vcl_size_t maximumCityblockDistance) noexcept
static constexpr vcl_size_t CalculateNumberOfOffsets(const vcl_size_t maximumCityblockDistance, const bool includeCenterPixel) noexcept
static constexpr uintmax_t CalculatePowerOfTwo(const vcl_size_t n) noexcept
vcl_size_t m_NumberOfOffsets
constexpr vcl_size_t GetNumberOfOffsets() const noexcept
bool m_IncludeCenterPixel
static constexpr unsigned int ImageDimension
static constexpr vcl_size_t CalculateSumOfNumberOfHypercubesOnBoundaryOfCube(const vcl_size_t i, const vcl_size_t m) noexcept
static constexpr uintmax_t CalculateSum(const uintmax_t a, const uintmax_t b) noexcept
static constexpr vcl_size_t CalculateNumberOfHypercubesOnBoundaryOfCube(const vcl_size_t m, const vcl_size_t n) noexcept
vcl_size_t m_MaximumCityblockDistance
constexpr ConnectedImageNeighborhoodShape(const vcl_size_t maximumCityblockDistance, const bool includeCenterPixel) noexcept
static constexpr uintmax_t CalculateBinomialCoefficient(const uintmax_t n, const uintmax_t k) noexcept
void FillOffsets(Offset< ImageDimension > *const offsets) const noexcept
constexpr TReturnType UnsignedPower(const uintmax_t base, const uintmax_t exponent) noexcept
constexpr TReturnType UnsignedProduct(const uintmax_t a, const uintmax_t b) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
auto GenerateConnectedImageNeighborhoodShapeOffsets() noexcept
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
constexpr iterator begin()