int
main(int argc, char * argv[])
{
if (argc < 6)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputImageFile outputGradientImageFile ";
std::cerr << "outputSmoothedGradientImageFile ";
std::cerr << "numberOfIterations timeStep " << std::endl;
return EXIT_FAILURE;
}
using InputPixelType = float;
reader->SetFileName(argv[1]);
using FilterType =
VectorImageType>;
using GradientFilterType =
VectorImageType>;
gradient->SetInput(reader->GetOutput());
filter->SetInput(gradient->GetOutput());
const unsigned int numberOfIterations = std::stoi(argv[4]);
const double timeStep = std::stod(argv[5]);
filter->SetNumberOfIterations(numberOfIterations);
filter->SetTimeStep(timeStep);
filter->SetConductanceParameter(1.0);
filter->Update();
using OutputPixelType = float;
using ComponentFilterType =
OutputImageType>;
component->SetIndex(0);
using WritePixelType = unsigned char;
using RescaleFilterType =
rescaler->SetOutputMinimum(0);
rescaler->SetOutputMaximum(255);
rescaler->SetInput(component->GetOutput());
writer->SetInput(rescaler->GetOutput());
component->SetInput(gradient->GetOutput());
writer->SetFileName(argv[2]);
writer->Update();
component->SetInput(filter->GetOutput());
writer->SetFileName(argv[3]);
writer->Update();
return EXIT_SUCCESS;
}