#include <iostream>
int
main(int argc, char * argv[])
{
if (argc < 8)
{
std::cerr << "Missing Parameters " << std::endl;
std::cerr << "Usage: " << argv[0];
std::cerr
<< " inputImage outputImage conductanceTerm diffusionIterations "
"lowerThreshold outputScaleLevel gradientMode "
<< std::endl;
return EXIT_FAILURE;
}
using DiffusionFilterType =
VectorImageType>;
using GradientMagnitudeFilterType =
reader->SetFileName(argv[1]);
diffusion->SetNumberOfIterations(std::stoi(argv[4]));
diffusion->SetConductanceParameter(std::stod(argv[3]));
diffusion->SetTimeStep(0.125);
gradient->SetUsePrincipleComponents(std::stoi(argv[7]));
watershed->SetLevel(std::stod(argv[6]));
watershed->SetThreshold(std::stod(argv[5]));
using ColormapFunctorType =
using ColormapFilterType =
RGBImageType,
ColormapFunctorType>;
writer->SetFileName(argv[2]);
caster->SetInput(reader->GetOutput());
diffusion->SetInput(caster->GetOutput());
gradient->SetInput(diffusion->GetOutput());
watershed->SetInput(gradient->GetOutput());
colormapper->SetInput(watershed->GetOutput());
writer->SetInput(colormapper->GetOutput());
try
{
writer->Update();
}
{
std::cerr <<
e << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}