int
main(int argc, char * argv[])
{
if (argc != 6)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0];
std::cerr << " <InputFileName> <OutputFileName> <radius> <majority threshold> <number of iterations>";
std::cerr << std::endl;
return EXIT_FAILURE;
}
const char * inputFileName = argv[1];
const char * outputFileName = argv[2];
int r = std::stoi(argv[3]);
int majorityThreshold = std::stoi(argv[4]);
unsigned int numberOfIterations = std::stoi(argv[5]);
using PixelType = unsigned char;
const auto input = itk::ReadImage<ImageType>(inputFileName);
FilterType::InputSizeType radius;
radius.Fill(r);
filter->SetInput(input);
filter->SetRadius(radius);
filter->SetMajorityThreshold(majorityThreshold);
filter->SetMaximumNumberOfIterations(numberOfIterations);
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}