19 #ifndef itkConnectedImageNeighborhoodShape_h
20 #define itkConnectedImageNeighborhoodShape_h
35 # define ITK_X_ASSERT(CHECK) void(0)
37 # define ITK_X_ASSERT(CHECK) ((CHECK) ? void(0) : [] { assert(!#CHECK); }())
96 template <
unsigned int VImageDimension>
115 const bool includeCenterPixel) noexcept
137 assert(offsets !=
nullptr);
146 const size_t numberOfNonZeroOffsetValues =
157 for (
unsigned int direction = 0; direction <
ImageDimension; ++direction)
159 auto & offsetValue = offset[direction];
163 if (offsetValue <= 1)
188 static constexpr uintmax_t
191 return ((a + b) >= a) && ((a + b) >= b) ? (a + b) : (
ITK_X_ASSERT(!
"CalculateSum overflow!"), 0);
197 static constexpr uintmax_t
200 return (n < std::numeric_limits<uintmax_t>::digits) ? (uintmax_t{ 1 } << n)
209 static constexpr uintmax_t
220 static constexpr
size_t
235 static constexpr
size_t
245 static constexpr
size_t
248 return (((maximumCityblockDistance == 0) || (
ImageDimension == 0))
258 static constexpr
size_t
268 template <
unsigned int VImageDimension,
size_t VMaximumCityblockDistance,
bool VIncludeCenterPixel>
274 shape.FillOffsets(offsets.data());