int
main()
{
auto size = ImageType::SizeType::Filled(10);
image->SetRegions(region);
image->Allocate();
image->FillBuffer(5);
std::cout << "Image largest region: " << image->GetLargestPossibleRegion() << std::endl;
auto desiredStart = ImageType::IndexType::Filled(3);
auto desiredSize = ImageType::SizeType::Filled(4);
std::cout << "desiredRegion: " << desiredRegion << std::endl;
filter->SetExtractionRegion(desiredRegion);
filter->SetInput(image);
#if ITK_VERSION_MAJOR >= 4
filter->SetDirectionCollapseToIdentity();
#endif
filter->Update();
output->DisconnectPipeline();
output->FillBuffer(2);
std::cout << "new largest region: " << output->GetLargestPossibleRegion() << std::endl;
std::cout << "new: " << (int)output->GetPixel(index) << std::endl;
std::cout << "Original: " << (int)image->GetPixel(index) << std::endl;
return EXIT_SUCCESS;
}