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;
}
A templated class holding a n-Dimensional covariant vector.
Computes the gradient of an image by convolution with the first derivative of a Gaussian.
Data source that reads image data from a single file.
Writes image data to a single file.
Templated n-dimensional image class.
Applies a linear transformation to the intensity levels of the input Image.
Extracts the selected index of the vector that is the input pixel type.