int
main(int argc, char * argv[])
{
if (argc < 4)
{
std::cerr << "Usage: " << std::endl;
std::cerr
<< argv[0]
<< " inputImageFile outputImageFile sigma [RescaledOutputImageFile] "
<< std::endl;
return EXIT_FAILURE;
}
using InputPixelType = float;
using OutputPixelType = float;
using FilterType =
OutputImageType>;
reader->SetFileName(argv[1]);
laplacian->SetNormalizeAcrossScale(false);
laplacian->SetInput(reader->GetOutput());
const double sigma = std::stod(argv[3]);
laplacian->SetSigma(sigma);
try
{
laplacian->Update();
}
{
std::cout << "ExceptionObject caught !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
using WritePixelType = float;
writer->SetInput(laplacian->GetOutput());
writer->SetFileName(argv[2]);
writer->Update();
if (argc > 4)
{
using CharPixelType = unsigned char;
using RescaleFilterType =
rescale->SetInput(laplacian->GetOutput());
rescale->SetOutputMinimum(0);
rescale->SetOutputMaximum(255);
charWriter->SetFileName(argv[4]);
charWriter->SetInput(rescale->GetOutput());
charWriter->Update();
}
return EXIT_SUCCESS;
}