int main( int argc, char* argv[] )
{
if( argc != 2 )
{
std::cerr << "Usage: " << argv[0] << " <NumberOfSplits>" << std::endl;
return EXIT_FAILURE;
}
int numberOfSplits = atoi( argv[1] );
typedef unsigned char PixelType;
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();
}
{
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( size_t ii = 0; ii < updatedRequestedRegions.size(); ++ii )
{
std::cout << " " << updatedRequestedRegions[ii] << std::endl;
}
return EXIT_SUCCESS;
}