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;
SourceType::Pointer source = SourceType::New();
size.
Fill(numberOfSplits);
source->SetSize(size);
MonitorFilterType::Pointer monitorFilter = MonitorFilterType::New();
monitorFilter->SetInput(source->GetOutput());
monitorFilter->DebugOn();
StreamingFilterType::Pointer streamingFilter = StreamingFilterType::New();
streamingFilter->SetInput(monitorFilter->GetOutput());
streamingFilter->SetNumberOfStreamDivisions(numberOfSplits);
try
{
streamingFilter->Update();
}
catch (itk::ExceptionObject & error)
{
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;
}