X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=tools%2Fpjinfo.cpp;h=85d1964e1835cbf9cddbb15dd5e8b5daef58f354;hp=9be697f1ea3d0a1eafee7e517e62eb1ccef5ee8f;hb=f13a8c004b8f182b42d9e4df2bcd7c7f030bf1ad;hpb=5ff5b33a6bc64fb804106c4d50b83e4cf0d7b0f4 diff --git a/tools/pjinfo.cpp b/tools/pjinfo.cpp index 9be697f..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: pjinfo.cpp,v 1.5 2001/01/10 21:21:53 kevin Exp $ +** 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 @@ -50,9 +48,9 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.5 2001/01/10 21:21:53 kevin Exp $"; +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