int main( int argc, char * argv[] )
{
if( argc < 7 )
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputImageFile outputImageFile";
std::cerr << " OutputMin OutputMax SigmoidAlpha SigmoidBeta" << std::endl;
return EXIT_FAILURE;
}
typedef unsigned char InputPixelType;
typedef unsigned char OutputPixelType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( argv[1] );
writer->SetFileName( argv[2] );
InputImageType, OutputImageType > SigmoidFilterType;
SigmoidFilterType::Pointer sigmoidFilter = SigmoidFilterType::New();
const OutputPixelType outputMinimum = atoi( argv[3] );
const OutputPixelType outputMaximum = atoi( argv[4] );
sigmoidFilter->SetOutputMinimum( outputMinimum );
sigmoidFilter->SetOutputMaximum( outputMaximum );
const double alpha = atof( argv[5] );
const double beta = atof( argv[6] );
sigmoidFilter->SetAlpha( alpha );
sigmoidFilter->SetBeta( beta );
sigmoidFilter->SetInput( reader->GetOutput() );
writer->SetInput( sigmoidFilter->GetOutput() );
writer->Update();
return EXIT_SUCCESS;
}