int
main(int argc, char * argv[])
{
if (argc != 5)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0];
std::cerr << " <InputFileName> <Real filename> <Imaginary filename> <Modulus filename>";
std::cerr << std::endl;
return EXIT_FAILURE;
}
const char * inputFileName = argv[1];
const char * realFileName = argv[2];
const char * imaginaryFileName = argv[3];
const char * modulusFileName = argv[4];
using FloatPixelType = float;
const auto input = itk::ReadImage<FloatImageType>(inputFileName);
using UnsignedCharPixelType = unsigned char;
padFilter->SetInput(input);
padding[0] = 0;
padding[1] = 2;
padding[2] = 6;
padFilter->SetPadUpperBound(padding);
fftFilter->SetInput(padFilter->GetOutput());
using FFTOutputImageType = FFTType::OutputImageType;
realFilter->SetInput(fftFilter->GetOutput());
realRescaleFilter->SetInput(realFilter->GetOutput());
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
imaginaryFilter->SetInput(fftFilter->GetOutput());
imaginaryRescaleFilter->SetInput(imaginaryFilter->GetOutput());
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
modulusFilter->SetInput(fftFilter->GetOutput());
magnitudeRescaleFilter->SetInput(modulusFilter->GetOutput());
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}