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)
211 static constexpr
size_t
226 static constexpr
size_t
235 static constexpr
size_t
238 return (((maximumCityblockDistance == 0) || (
ImageDimension == 0))
248 static constexpr
size_t
258 template <
unsigned int VImageDimension,
size_t VMaximumCityblockDistance,
bool VIncludeCenterPixel>
264 shape.FillOffsets(offsets.data());