int
main(int argc, char * argv[])
{
if (argc != 2)
{
std::cerr << "Usage: " << argv[0] << " <NumberOfSplits>" << std::endl;
return EXIT_FAILURE;
}
int numberOfSplits = std::stoi(argv[1]);
using PixelType = unsigned char;
auto size = ImageType::SizeType::Filled(numberOfSplits);
source->SetSize(size);
monitorFilter->SetInput(source->GetOutput());
monitorFilter->DebugOn();
streamingFilter->SetInput(monitorFilter->GetOutput());
streamingFilter->SetNumberOfStreamDivisions(numberOfSplits);
try
{
streamingFilter->Update();
}
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
std::cout << "The output LargestPossibleRegion is: " << streamingFilter->GetOutput()->GetLargestPossibleRegion()
<< std::endl;
std::cout << std::endl;
const MonitorFilterType::RegionVectorType updatedRequestedRegions = monitorFilter->GetUpdatedRequestedRegions();
std::cout << "Updated RequestedRegions's:" << std::endl;
for (const auto & updatedRequestedRegion : updatedRequestedRegions)
{
std::cout << " " << updatedRequestedRegion << std::endl;
}
return EXIT_SUCCESS;
}