#include "itksys/SystemTools.hxx"
#include <sstream>
int main( int argc, char *argv[])
{
if(argc < 4)
{
std::cerr << "Required: filename.png seedX seedY" << std::endl;
return EXIT_FAILURE;
}
std::string inputFileName = argv[1];
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(inputFileName.c_str());
reader->Update();
ConfidenceConnectedFilterType::Pointer confidenceConnectedFilter = ConfidenceConnectedFilterType::New();
confidenceConnectedFilter->SetInitialNeighborhoodRadius(3);
confidenceConnectedFilter->SetMultiplier(3);
confidenceConnectedFilter->SetNumberOfIterations(25);
confidenceConnectedFilter->SetReplaceValue(255);
seed[0] = atoi(argv[2]);
seed[1] = atoi(argv[3]);
confidenceConnectedFilter->SetSeed(seed);
confidenceConnectedFilter->SetInput(reader->GetOutput());
reader->GetOutput(),true,
itksys::SystemTools::GetFilenameName(inputFileName));
std::stringstream desc;
desc << "ConfidenceConnected Seed: " << seed[0] << ", " << seed[1];
confidenceConnectedFilter->GetOutput(),
true,
desc.str());
return EXIT_SUCCESS;
}