int
main(int argc, char * argv[])
{
if (argc < 3)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputImage outputImage " << std::endl;
return EXIT_FAILURE;
}
const char * inputFilename = argv[1];
const char * outputFilename = argv[2];
using CharPixelType = unsigned char;
using RescaleFilter =
using LaplacianSharpeningFilter =
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
RescaleFilter::Pointer rescale = RescaleFilter::New();
LaplacianSharpeningFilter::Pointer lapFilter =
LaplacianSharpeningFilter::New();
reader->SetFileName(inputFilename);
writer->SetFileName(outputFilename);
lapFilter->SetInput(reader->GetOutput());
rescale->SetInput(lapFilter->GetOutput());
writer->SetInput(rescale->GetOutput());
rescale->SetOutputMinimum(0);
rescale->SetOutputMaximum(255);
try
{
writer->Update();
}
catch (const itk::ExceptionObject & err)
{
std::cout << "ExceptionObject caught !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}