int main( int argc, char * argv[] )
{
if( argc < 4 )
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputImageFile outputImageFile sigma" << std::endl;
return EXIT_FAILURE;
}
using InputPixelType = float;
using OutputPixelType = float;
InputImageType, OutputImageType >;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( argv[1] );
FilterType::Pointer filter = FilterType::New();
filter->SetInput( reader->GetOutput() );
const double sigma = std::stod( argv[3] );
filter->SetSigma( sigma );
filter->Update();
using WritePixelType = unsigned char;
OutputImageType, WriteImageType >;
RescaleFilterType::Pointer rescaler = RescaleFilterType::New();
rescaler->SetOutputMinimum( 0 );
rescaler->SetOutputMaximum( 255 );
WriterType::Pointer writer = WriterType::New();
writer->SetFileName( argv[2] );
rescaler->SetInput( filter->GetOutput() );
writer->SetInput( rescaler->GetOutput() );
writer->Update();
return EXIT_SUCCESS;
}