#include <cassert>
#include <numeric>
namespace
{
template <typename TImage>
CreateImageWithSequentiallyIncreasingPixelValues(
const typename TImage::RegionType & region)
{
using PixelType = typename TImage::PixelType;
image->SetRegions(region);
image->Allocate();
std::iota(imageBufferRange.
begin(), imageBufferRange.
end(), PixelType{ 0 });
return image;
}
template <typename TImage>
void
PrintPixelValues(const TImage & image)
{
constexpr
unsigned int Dimension{ TImage::ImageDimension };
using PixelType = typename TImage::PixelType;
std::cout <<
"Region index: " << region.
GetIndex() <<
"; Region size: " << region.
GetSize() <<
"\n\n";
auto indexIterator = indexRange.
cbegin();
for (const PixelType pixel : imageBufferRange)
{
std::cout << "Pixel index: " << index << "; Pixel value: " << PrintType{ pixel } << '\n';
++indexIterator;
}
assert(indexIterator == indexRange.
cend());
}
}
int
main()
{
using PixelType = unsigned char;
PrintPixelValues(*image);
}