int main( int argc, char *argv[])
{
if( argc < 2 )
{
std::cerr << "Usage: " << argv[0];
std::cerr << " inputImage [iterations]" << std::endl;
return EXIT_FAILURE;
}
int iterations = 5;
if (argc > 2)
{
iterations = atoi(argv[2]);
}
typedef float InternalPixelType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( argv[1] );
CurvatureFlowImageFilterType::Pointer smoothing = CurvatureFlowImageFilterType::New();
smoothing->SetInput( reader->GetOutput() );
smoothing->SetNumberOfIterations( iterations );
smoothing->SetTimeStep( 0.125 );
SubtractImageFilterType::Pointer diff = SubtractImageFilterType::New();
diff->SetInput1(reader->GetOutput());
diff->SetInput2(smoothing->GetOutput());
reader->GetOutput(),true,
itksys::SystemTools::GetFilenameName(argv[1]));
std::stringstream desc;
desc << "CurvatureFlow\niterations = " << iterations;
smoothing->GetOutput(),
true,
desc.str());
std::stringstream desc2;
desc2 << "Original - CurvatureFlow";
diff->GetOutput(),
true,
desc2.str());
return EXIT_SUCCESS;
}