19 #ifndef itkConnectedImageNeighborhoodShape_h
20 #define itkConnectedImageNeighborhoodShape_h
86 template <
unsigned int VImageDimension>
105 const bool includeCenterPixel) noexcept
127 assert(offsets !=
nullptr);
136 const size_t numberOfNonZeroOffsetValues =
147 for (
unsigned int direction = 0; direction <
ImageDimension; ++direction)
149 auto & offsetValue = offset[direction];
153 if (offsetValue <= 1)
178 static constexpr uintmax_t
181 return ((a + b) >= a) && ((a + b) >= b) ? (a + b) : (assert(!
"CalculateSum overflow!"), 0);
187 static constexpr uintmax_t
190 return (n < std::numeric_limits<uintmax_t>::digits) ? (uintmax_t{ 1 } << n)
191 : (assert(!
"CalculatePowerOfTwo overflow!"), 0);
199 static constexpr uintmax_t
202 return (k > n) ? (assert(!
"Out of range!"), 0)
210 static constexpr
size_t
225 static constexpr
size_t
234 static constexpr
size_t
237 return (((maximumCityblockDistance == 0) || (
ImageDimension == 0))
247 static constexpr
size_t
257 template <
unsigned int VImageDimension,
size_t VMaximumCityblockDistance,
bool VIncludeCenterPixel>
263 shape.FillOffsets(offsets.data());