int
main(int argc, char * argv[])
{
if (argc != 5)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0];
std::cerr << " <InputFileName> <OutputFileName> <translation X> <translation Y>";
std::cerr << std::endl;
return EXIT_FAILURE;
}
const char * inputFileName = argv[1];
const char * outputFileName = argv[2];
using PixelType = unsigned char;
const auto input = itk::ReadImage<ImageType>(inputFileName);
TransformType::OutputVectorType vector;
vector[0] = std::stod(argv[3]);
vector[1] = std::stod(argv[4]);
translation->Translate(vector);
resampleFilter->SetTransform(translation.GetPointer());
resampleFilter->SetInput(input);
resampleFilter->SetSize(input->GetLargestPossibleRegion().GetSize());
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}