int
main(int argc, char * argv[])
{
if (argc != 6)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0];
std::cerr << "<InputImage> <OutputImage> ";
std::cerr << "<Variance> <LowerThreshold> <UpperThreshold>";
std::cerr << std::endl;
return EXIT_FAILURE;
}
using InputPixelType = float;
using OutputPixelType = unsigned char;
const char * inputImage = argv[1];
const char * outputImage = argv[2];
const InputPixelType variance = std::stod(argv[3]);
const InputPixelType lowerThreshold = std::stod(argv[4]);
const InputPixelType upperThreshold = std::stod(argv[5]);
const auto input = itk::ReadImage<InputImageType>(inputImage);
filter->SetInput(input);
filter->SetVariance(variance);
filter->SetLowerThreshold(lowerThreshold);
filter->SetUpperThreshold(upperThreshold);
rescaler->SetInput(filter->GetOutput());
rescaler->SetOutputMinimum(0);
rescaler->SetOutputMaximum(255);
try
{
}
catch (
const itk::ExceptionObject &
e)
{
std::cerr <<
"Error: " <<
e << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}