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 RealPixelType = double;
using CastToRealFilterType =
using CastToCharFilterType =
using RescaleFilter =
using LaplacianFilter =
using ZeroCrossingFilter =
reader->SetFileName(inputFilename);
writer->SetFileName(outputFilename);
rescale->SetOutputMinimum(0);
rescale->SetOutputMaximum(255);
toReal->SetInput(reader->GetOutput());
toChar->SetInput(rescale->GetOutput());
writer->SetInput(toChar->GetOutput());
lapFilter->SetInput(toReal->GetOutput());
zeroFilter->SetInput(lapFilter->GetOutput());
rescale->SetInput(zeroFilter->GetOutput());
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;
}