int
main(int argc, char * argv[])
{
if (argc < 5)
{
std::cerr << "Missing Parameters " << std::endl;
std::cerr << "Usage: " << argv[0];
std::cerr << " inputImage outputImage seedX seedY " << std::endl;
return EXIT_FAILURE;
}
using InternalPixelType = float;
constexpr unsigned int Dimension = 2;
using OutputPixelType = unsigned char;
using CastingFilterType =
auto caster = CastingFilterType::New();
using CurvatureFlowImageFilterType =
auto smoothing = CurvatureFlowImageFilterType::New();
using ConnectedFilterType =
auto confidenceConnected = ConnectedFilterType::New();
smoothing->SetInput(input);
confidenceConnected->SetInput(smoothing->GetOutput());
caster->SetInput(confidenceConnected->GetOutput());
smoothing->SetNumberOfIterations(5);
smoothing->SetTimeStep(0.125);
confidenceConnected->SetMultiplier(2.5);
confidenceConnected->SetNumberOfIterations(5);
confidenceConnected->SetReplaceValue(255);
InternalImageType::IndexType index;
index[0] = std::stoi(argv[3]);
index[1] = std::stoi(argv[4]);
confidenceConnected->SetSeed(index);
confidenceConnected->SetInitialNeighborhoodRadius(2);
try
{
}
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << excep << std::endl;
}
return EXIT_SUCCESS;
}
Casts input pixels to output pixel type.
Segment pixels with similar statistics using connectivity.
Denoise an image using curvature driven flow.
Standard exception handling object.
Templated n-dimensional image class.
ITK_TEMPLATE_EXPORT void WriteImage(TImagePointer &&image, const std::string &filename, bool compress=false)
TOutputImage::Pointer ReadImage(const std::string &filename)