int
main(int argc, char * argv[])
{
if (argc < 7)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << std::endl;
std::cerr << " <InputImage> <OutputImage> <LowerThreshold>";
std::cerr << " <UpperThreshold> <OutsideValue> <InsideValue>" << std::endl;
return EXIT_FAILURE;
}
using PixelType = unsigned char;
const char * InputImage = argv[1];
const char * OutputImage = argv[2];
const auto LowerThreshold = static_cast<PixelType>(atoi(argv[3]));
const auto UpperThreshold = static_cast<PixelType>(atoi(argv[4]));
const auto OutsideValue = static_cast<PixelType>(atoi(argv[5]));
const auto InsideValue = static_cast<PixelType>(atoi(argv[6]));
const auto input = itk::ReadImage<ImageType>(InputImage);
filter->SetInput(input);
filter->SetLowerThreshold(LowerThreshold);
filter->SetUpperThreshold(UpperThreshold);
filter->SetOutsideValue(OutsideValue);
filter->SetInsideValue(InsideValue);
try
{
}
catch (
const itk::ExceptionObject &
e)
{
std::cerr <<
"Error: " <<
e << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}