int
main(int argc, char * argv[])
{
if (argc < 5)
{
std::cerr << "Usage: " << argv[0];
std::cerr << " inputImageFile outputDistanceMapImageFile ";
std::cerr << " outputVoronoiMapImageFile ";
std::cerr << " outputVectorMapImageFile ";
std::cerr << std::endl;
return EXIT_FAILURE;
}
using InputPixelType = unsigned char;
using OutputPixelType = unsigned short;
using VoronoiPixelType = unsigned char;
using LabelerType =
OutputImageType,
VoronoiImageType>;
using RescalerType =
using VoronoiRescalerType =
reader->SetFileName(argv[1]);
writer->SetFileName(argv[2]);
voronoiWriter->SetFileName(argv[3]);
labeler->SetInput(reader->GetOutput());
filter->SetInput(labeler->GetOutput());
scaler->SetInput(filter->GetOutput());
writer->SetInput(scaler->GetOutput());
voronoiScaler->SetInput(filter->GetVoronoiMap());
voronoiWriter->SetInput(voronoiScaler->GetOutput());
scaler->SetOutputMaximum(65535L);
scaler->SetOutputMinimum(0L);
voronoiScaler->SetOutputMaximum(255);
voronoiScaler->SetOutputMinimum(0);
writer->Update();
voronoiWriter->Update();
using OffsetImageType = FilterType::VectorImageType;
offsetWriter->SetInput(filter->GetVectorDistanceMap());
offsetWriter->SetFileName(argv[4]);
try
{
offsetWriter->Update();
}
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << exp << std::endl;
}
return EXIT_SUCCESS;
}
Label the objects in a binary image.
This filter computes the distance map of the input image as an approximation with pixel accuracy to t...
Standard exception handling object.
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.