X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=tools%2Fphm2if.cpp;h=3d1915c0f3bf48139c3a5167ad9122c6dc3a0e40;hp=d87afaffc65a69bbe3724ca77eafa89f8565b6c6;hb=3147cd44cff6132e51eac1a179c1fc3d405faacc;hpb=93eb50659a64db3e37753d36c9923e82c7f7ca8a diff --git a/tools/phm2if.cpp b/tools/phm2if.cpp index d87afaf..3d1915c 100644 --- a/tools/phm2if.cpp +++ b/tools/phm2if.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phm2if.cpp,v 1.5 2000/08/02 18:06:00 kevin Exp $ +** $Id: phm2if.cpp,v 1.12 2000/09/04 09:06:46 kevin Exp $ ** ** 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 @@ -50,7 +50,7 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* szIdStr = "$Id"; +static const char* g_szIdStr = "$Id: phm2if.cpp,v 1.12 2000/09/04 09:06:46 kevin Exp $"; void phm2if_usage (const char *program) @@ -63,9 +63,9 @@ phm2if_usage (const char *program) cout << " ny Number of pixels Y-axis" << endl; cout << " --phantom Phantom to use for projection" << endl; cout << " herman Herman head phantom" << endl; - cout << " bherman Bordered Herman head phantom" << endl; - cout << " rowland Rowland head phantom" << endl; - cout << " browland Bordered Rowland head phantom" << endl; + cout << " herman-b Herman head phantom (Bordered)" << endl; + cout << " shepp-logan Shepp-Logan head phantom" << endl; + cout << " shepp-logan-b Shepp-Logan head phantom (Bordered)" << endl; cout << " unitpulse Unit pulse phantom" << endl; cout << " --phmfile Generate Phantom from phantom file" << endl; cout << " --filter Generate Phantom from a filter function" << endl; @@ -88,9 +88,9 @@ phm2if_usage (const char *program) cout << " --nsample Number of samples per axis per pixel (default = 1)" << endl; cout << " --trace Trace level to use" << endl; cout << " none No tracing (default)" << endl; - cout << " text Trace text level" << endl; - cout << " phm Trace phantom" << endl; - cout << " rays Trace rays" << endl; + cout << " console Trace text level" << endl; + cout << " phantom Trace phantom" << endl; + cout << " proj Trace projections" << endl; cout << " plot Trace plot" << endl; cout << " clipping Trace clipping" << endl; cout << " --debug Debug mode" << endl; @@ -119,9 +119,11 @@ phm2if_main (int argc, char* argv[]) int opt_nsample = 1; double optFilterParam = 1.; double optFilterBW = 1.; - int optTrace = TRACE_NONE; + int optTrace = Trace::TRACE_NONE; bool optVerbose = false; bool optDebug = false; + char *endptr = NULL; + char *endstr; Timer timerProgram; #ifdef HAVE_MPI @@ -131,9 +133,6 @@ phm2if_main (int argc, char* argv[]) #endif while (1) { int c = getopt_long(argc, argv, "", my_options, NULL); - char *endptr = NULL; - char *endstr; - if (c == -1) break; @@ -151,7 +150,7 @@ phm2if_main (int argc, char* argv[]) optDebug = true; break; case O_TRACE: - if ((optTrace = TraceLevel::convertTraceNameToID(optarg)) == TRACE_INVALID) { + if ((optTrace = Trace::convertTraceNameToID(optarg)) == Trace::TRACE_INVALID) { phm2if_usage(argv[0]); return (1); } @@ -194,7 +193,7 @@ phm2if_main (int argc, char* argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl; + cout << "Version " << VERSION << endl << g_szIdStr << endl; #else cerr << "Unknown version number" << endl; #endif @@ -317,7 +316,7 @@ phm2if_main (int argc, char* argv[]) } } else { TimerCollectiveMPI timerRasterize (mpiWorld.getComm()); - phm.convertToImagefile (*pImLocal, opt_nsample, optTrace, mpiWorld.getMyStartWorkUnit(), mpiWorld.getMyLocalWorkUnits()); + phm.convertToImagefile (*pImLocal, opt_nsample, optTrace, mpiWorld.getMyStartWorkUnit(), mpiWorld.getMyLocalWorkUnits(), false); if (optVerbose) timerRasterize.timerEndAndReport ("Time to rasterize phantom"); @@ -334,7 +333,7 @@ phm2if_main (int argc, char* argv[]) pImGlobal->filterResponse (optDomainName.c_str(), optFilterBW, optFilterName.c_str(), optFilterParam); } else { #if HAVE_SGP - if (optTrace >= TRACE_PHM) + if (optTrace >= Trace::TRACE_PHANTOM) phm.show(); #endif phm.convertToImagefile (*pImGlobal, opt_nsample, optTrace); @@ -351,7 +350,7 @@ phm2if_main (int argc, char* argv[]) if (optVerbose) cout << "Time to rasterized phantom: " << calctime << " seconds" << endl; - if (optTrace >= TRACE_PHM) { + if (optTrace >= Trace::TRACE_PHANTOM) { double dmin, dmax; int nscale;