int
main(int argc, char * argv[])
{
if (argc != 5)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0];
std::cerr << " <InputFileName> <OutputFileNameX> <OutputFileNameY> <OutputFileNameMagnitude>";
std::cerr << std::endl;
return EXIT_FAILURE;
}
const char * inputFileName = argv[1];
const char * outputFileNameX = argv[2];
const char * outputFileNameY = argv[3];
const char * outputFileNameMagnitude = argv[4];
const char * filenames[2];
filenames[0] = outputFileNameX;
filenames[1] = outputFileNameY;
using PixelType = unsigned char;
using DoublePixelType = double;
const auto input = itk::ReadImage<ImageType>(inputFileName);
filter->SetInput(input);
indexSelectionFilter->SetInput(filter->GetOutput());
rescaler->SetInput(indexSelectionFilter->GetOutput());
for (int i = 0; i < 2; ++i)
{
indexSelectionFilter->SetIndex(i);
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
}
magnitudeFilter->SetInput(filter->GetOutput());
rescaler->SetInput(magnitudeFilter->GetOutput());
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}