int
main(int argc, char * argv[])
{
if (argc < 3)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputRGBImageFile outputGrayscaleImageFile "
<< std::endl;
return EXIT_FAILURE;
}
reader->SetFileName(argv[1]);
using FilterType =
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
writer->SetFileName(argv[2]);
try
{
writer->Update();
}
catch (const itk::ExceptionObject & excp)
{
std::cerr << "Exception Thrown" << std::endl;
std::cerr << excp << std::endl;
}
return EXIT_SUCCESS;
}