1 /*****************************************************************************
5 ** Purpose: Convert an projection data file to an image file
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: April 2000
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2000 Kevin Rosenberg
12 ** $Id: pjinfo.cpp,v 1.1 2000/09/02 05:17:29 kevin Exp $
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
29 * pjfinfo.c Convert Raysum to image
39 enum { O_DUMP, O_HELP, O_VERSION };
41 static struct option my_options[] =
43 {"dump", 0, 0, O_DUMP},
44 {"help", 0, 0, O_HELP},
45 {"version", 0, 0, O_VERSION},
49 static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.1 2000/09/02 05:17:29 kevin Exp $";
52 pjfinfo_usage (const char *program)
54 cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]" << endl;
55 cout << "Display projection file information" << endl;
57 cout << " --dump Dump all scan data" << endl;
58 cout << " --version Print version" << endl;
59 cout << " --help Print this help message" << endl;
65 pjfinfo_main (const int argc, char *const argv[])
74 int c = getopt_long (argc, argv, "", my_options, NULL);
85 cout << "Version " << VERSION << endl << g_szIdStr << endl;
87 cout << "Unknown version number" << endl;
92 pjfinfo_usage(argv[0]);
95 pjfinfo_usage(argv[0]);
100 if (argc - optind != 1) {
101 pjfinfo_usage(argv[0]);
105 pj_name = argv[optind];
108 if (! pj.read (pj_name)) {
109 sys_error (ERR_SEVERE, "Can not open projection file %s", pj_name.c_str());
114 pj.printProjectionData();
117 pj.printScanInfo (os);
127 main (const int argc, char *const argv[])
132 retval = pjfinfo_main(argc, argv);
133 } catch (exception e) {
134 cerr << "Exception: " << e.what() << endl;
136 cerr << "Unknown exception" << endl;