int
main(int argc, char * argv[])
{
if (argc != 2)
{
std::cerr << "Usage:" << std::endl;
std::cerr << argv[0] << " <OutputFileName>" << std::endl;
return EXIT_FAILURE;
}
const char * outputFileName = argv[1];
using PixelType = unsigned char;
RandomImageSourceType::Pointer randomImageSource = RandomImageSourceType::New();
randomImageSource->SetNumberOfWorkUnits(1);
randomImageSource->SetSize(size);
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFileName);
writer->SetInput(randomImageSource->GetOutput());
try
{
writer->Update();
}
catch (itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}