int main(int argc, char** argv) { if(argc != 3) { std::cout << "Usage: SNR input_file.exr reference.exr" << std::endl; //BOOST_LOG_TRIVIAL(fatal) << "The required number of arguments is uncorrect"; return EXIT_FAILURE; } std::string input_file(argv[1]) ; std::string ref_file(argv[2]) ; //float snr = SNR(input_file, ref_file) ; try { float snr = Metric<SnrStatistics>(input_file, ref_file); std::cout << "SNR = " << snr << "db" << std::endl; float rmse = Metric<RmseStatistics>(input_file, ref_file); std::cout << "RMSE = " << rmse << std::endl; } catch (const std::exception& e) { BOOST_LOG_TRIVIAL(fatal) << e.what(); return EXIT_FAILURE; } return EXIT_SUCCESS; }
void Ident_hist::parse_cmd_line(int argc, char *argv[]) { CmdLine cmdss("Comp Motiv", ' ', version.c_str()); ValueArg<string> read_file("q", "mapped_reads", "Mapped read file (sam/bam)", true, "#", "string"); cmdss.add(read_file); ValueArg<string> ref_file("r", "ref_file", "Reference file (fasta)", true, "#", "string"); cmdss.add(ref_file); ValueArg<string> out("o", "outputfile", "File to print the distripution to", true, "#", "string"); cmdss.add(out); try { cmdss.parse(argc, argv); //parse arguments read_filename = read_file.getValue(); output = out.getValue(); if (output[0] == '#') { output = read_filename; output += ".mot"; } reffile = ref_file.getValue(); } catch (ArgException &e) { StdOutput out; out.failure(cmdss, e); } }