int
main(int argc, char * argv[])
{
if (argc < 5)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0]
<< " inputImageFile outputImageFile flipAxisX flipAxisY"
<< std::endl;
return EXIT_FAILURE;
}
using PixelType = unsigned char;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName(argv[1]);
writer->SetFileName(argv[2]);
FilterType::Pointer filter = FilterType::New();
using FlipAxesArrayType = FilterType::FlipAxesArrayType;
FlipAxesArrayType flipArray;
flipArray[0] = std::stoi(argv[3]);
flipArray[1] = std::stoi(argv[4]);
filter->SetFlipAxes(flipArray);
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}