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) ITK_NOEXCEPT
124 constexpr std::size_t
137 assert(offsets !=
nullptr);
146 const std::size_t numberOfNonZeroOffsetValues =
157 for (
unsigned int direction = 0; direction <
ImageDimension; ++direction)
159 auto & offsetValue = offset[direction];
163 if (offsetValue <= 1)
191 return ((a + b) >= a) && ((a + b) >= b) ? (a + b) : (
ITK_X_ASSERT(!
"CalculateSum overflow!"), 0);
200 return (n < std::numeric_limits<std::uintmax_t>::digits) ? (
std::uintmax_t{ 1 } << n)
220 static constexpr std::size_t
235 static constexpr std::size_t
245 static constexpr std::size_t
248 return (((maximumCityblockDistance == 0) || (
ImageDimension == 0))
258 static constexpr std::size_t
265 template <
unsigned int VImageDimensionOfFriend, std::
size_t VMaximumCityblockDistance,
bool VIncludeCenterPixel>
269 VIncludeCenterPixel)>
275 template <
unsigned int VImageDimension, std::
size_t VMaximumCityblockDistance,
bool VIncludeCenterPixel>
276 std::array<
Offset<VImageDimension>,
278 VIncludeCenterPixel)>
283 shape.FillOffsets(offsets.data());