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;
}
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( argv[1] );
InputImageType,
OutputImageType >;
FilterType::Pointer filter = FilterType::New();
filter->SetInput( reader->GetOutput() );
WriterType::Pointer writer = WriterType::New();
writer->SetInput( filter->GetOutput() );
writer->SetFileName( argv[2] );
try
{
writer->Update();
}
{
std::cerr << "Exception Thrown" << std::endl;
std::cerr << excp << std::endl;
}
return EXIT_SUCCESS;
}