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];
const unsigned int Dimension = 2;
typedef unsigned char PixelType;
ImageType::SizeType size;
size.Fill( 10 );
RandomImageSourceType::Pointer randomImageSource =
RandomImageSourceType::New();
randomImageSource->SetNumberOfThreads(1);
randomImageSource->SetSize( size );
WriterType::Pointer writer = WriterType::New();
writer->SetFileName( outputFileName );
writer->SetInput( randomImageSource->GetOutput() );
try
{
writer->Update();
}
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}