X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tools%2Fpjinfo.cpp;h=85d1964e1835cbf9cddbb15dd5e8b5daef58f354;hb=HEAD;hp=dac36ad0c3e963077ba2532151599b0edf987ae7;hpb=8a7697ce57b56cdc43698cd1241ad98d49f9b5ac;p=ctsim.git diff --git a/tools/pjinfo.cpp b/tools/pjinfo.cpp index dac36ad..85d1964 100644 --- a/tools/pjinfo.cpp +++ b/tools/pjinfo.cpp @@ -7,9 +7,7 @@ ** Date Started: April 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg -** -** $Id$ +** Copyright (C) 1983-2009 Kevin Rosenberg ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -26,7 +24,7 @@ ******************************************************************************/ /* FILE -* pjinfo.c Convert Raysum to image +* pjinfo.c Convert Raysum to image * * DATE * August 2000 @@ -52,7 +50,7 @@ static struct option my_options[] = static const char* g_szIdStr = "$Id$"; -void +void pjinfo_usage (const char *program) { std::cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]\n"; @@ -69,7 +67,7 @@ pjinfo_usage (const char *program) -int +int pjinfo_main (const int argc, char *const argv[]) { std::string pj_name; @@ -79,14 +77,14 @@ pjinfo_main (const int argc, char *const argv[]) int optStartView = 0; int optEndView = -1; // tells copyViewData to use default last view extern int optind; - + while (1) { char *endptr, *endstr; int c = getopt_long (argc, argv, "", my_options, NULL); if (c == -1) break; - + switch (c) { case O_DUMP: @@ -132,14 +130,14 @@ pjinfo_main (const int argc, char *const argv[]) return (1); } } - + if (argc - optind != 1) { pjinfo_usage(argv[0]); return (1); } - + pj_name = argv[optind]; - + if (optBinaryHeader) Projections::copyHeader (pj_name, std::cout); else if (optBinaryViews) @@ -150,7 +148,7 @@ pjinfo_main (const int argc, char *const argv[]) sys_error (ERR_SEVERE, "Can not open projection file %s", pj_name.c_str()); return (1); } - + if (optDump) { pj.printProjectionData (optStartView, optEndView); } else { @@ -159,17 +157,17 @@ pjinfo_main (const int argc, char *const argv[]) std::cout << os.str(); } } - + return(0); } #ifndef NO_MAIN -int +int main (const int argc, char *const argv[]) { int retval = 1; - + try { retval = pjinfo_main(argc, argv); } catch (exception e) { @@ -177,7 +175,7 @@ main (const int argc, char *const argv[]) } catch (...) { std::cerr << "Unknown exception\n"; } - + return (retval); } #endif