int
main(int argc, char ** argv)
{
if (argc < 5)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << "directory regularExression ";
std::cerr << "sortingExpression outputImageFile " << std::endl;
return EXIT_FAILURE;
}
using PixelType = unsigned char;
const std::string directory = argv[1];
const std::string regularExpression = argv[2];
const unsigned int subMatch = std::stoi(argv[3]);
const std::string outputFilename = argv[4];
nameGenerator->SetRegularExpression(regularExpression);
nameGenerator->SetSubMatch(subMatch);
nameGenerator->SetDirectory(directory);
reader->SetFileNames(nameGenerator->GetFileNames());
writer->SetFileName(outputFilename);
writer->SetInput(reader->GetOutput());
try
{
writer->Update();
}
{
std::cerr << "ExceptionObject caught !" << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}