int main( int argc, char * argv[] )
{
if( argc < 5 )
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputImageFile outputImageFile";
std::cerr << " numberOfIterations noiseLevel" << std::endl;
return EXIT_FAILURE;
}
typedef float InputValueType;
typedef float OutputValueType;
InputImageType, OutputImageType > FilterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( argv[1] );
FilterType::Pointer filter = FilterType::New();
filter->SetInput( reader->GetOutput() );
const unsigned int numberOfIterations = atoi( argv[3] );
const double noiseLevel = atof( argv[4] );
filter->SetIterationNum( numberOfIterations );
filter->SetNoiseLevel( noiseLevel );
filter->Update();
WriterType::Pointer writer = WriterType::New();
writer->SetFileName( argv[2] );
writer->SetInput( filter->GetOutput() );
writer->Update();
return EXIT_SUCCESS;
}