int main(int argc, char *argv[])
{
if(argc < 3)
{
std::cerr << "Required: input output" << std::endl;
return EXIT_FAILURE;
}
std::string inputFilename = argv[1];
std::string outputFilename = argv[2];
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFilename);
reader->Update();
VectorRescaleFilterType::Pointer rescaleFilter = VectorRescaleFilterType::New();
rescaleFilter->SetInput(reader->GetOutput());
rescaleFilter->SetOutputMaximumMagnitude(255);
rescaleFilter->Update();
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputFilename);
writer->SetInput(rescaleFilter->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}