** 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 $
+** $Id$
**
** 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
******************************************************************************/
/* FILE
-* pjinfo.c Convert Raysum to image
+* pjinfo.c Convert Raysum to image
*
* DATE
* August 2000
{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";
-int
+int
pjinfo_main (const int argc, char *const argv[])
{
std::string pj_name;
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:
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)
sys_error (ERR_SEVERE, "Can not open projection file %s", pj_name.c_str());
return (1);
}
-
+
if (optDump) {
pj.printProjectionData (optStartView, optEndView);
} else {
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) {
} catch (...) {
std::cerr << "Unknown exception\n";
}
-
+
return (retval);
}
#endif