int
main(int argc, char * argv[])
{
if (argc < 4)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " <inputImage> <outputImage> <radius>";
std::cerr << std::endl;
return EXIT_FAILURE;
}
const char * inputImage = argv[1];
const char * outputImage = argv[2];
const unsigned int radiusValue = std::stoi(argv[3]);
using PixelType = unsigned char;
const auto input = itk::ReadImage<ImageType>(inputImage);
StructuringElementType::RadiusType radius;
radius.Fill(radiusValue);
StructuringElementType structuringElement = StructuringElementType::Ball(radius);
erodeFilter->SetInput(input);
erodeFilter->SetKernel(structuringElement);
try
{
}
catch (
const itk::ExceptionObject &
e)
{
std::cerr <<
"Error: " <<
e << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}