X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=tools%2Fpjrec.cpp;h=33fe7d3f6e45a7af71f1b6e38fdc1b9abf657db9;hp=19b9b86baea87d9e520595962dd3d09ae2c1bb86;hb=bfcc769cf8019eabc8c65c07257c8dbee4b4c977;hpb=1e88cf0f7fa4f690ea9f110e8ed3f2b5338d0a10 diff --git a/tools/pjrec.cpp b/tools/pjrec.cpp index 19b9b86..33fe7d3 100644 --- a/tools/pjrec.cpp +++ b/tools/pjrec.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pjrec.cpp,v 1.14 2000/08/25 15:59:13 kevin Exp $ +** $Id: pjrec.cpp,v 1.17 2000/09/02 05:10:39 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 @@ -49,7 +49,7 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.14 2000/08/25 15:59:13 kevin Exp $"; +static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.17 2000/09/02 05:10:39 kevin Exp $"; void pjrec_usage (const char *program) @@ -103,12 +103,12 @@ pjrec_usage (const char *program) cout << " idiff3 Highly-optimized difference method with integer math" << endl; cout << " --filter-param Alpha level for Hamming filter" << endl; cout << " --trace Set tracing to level" << endl; - cout << " none No tracing (default)" << endl; - cout << " text Text level tracing" << endl; - cout << " phm Trace phantom" << endl; - cout << " rays Trace allrays" << endl; - cout << " plot Trace plotting" << endl; - cout << " clipping Trace clipping" << endl; + cout << " none No tracing (default)" << endl; + cout << " console Text level tracing" << endl; + cout << " phantom Trace phantom" << endl; + cout << " proj Trace allrays" << endl; + cout << " plot Trace plotting" << endl; + cout << " clipping Trace clipping" << endl; cout << " --verbose Turn on verbose mode" << endl; cout << " --debug Turn on debug mode" << endl; cout << " --version Print version" << endl; @@ -133,7 +133,7 @@ pjrec_main (int argc, char * argv[]) bool bOptVerbose = false; bool bOptDebug = 1; int iOptZeropad = 1; - int optTrace = TRACE_NONE; + int optTrace = Trace::TRACE_NONE; double dOptFilterParam = -1; string sOptFilterName (SignalFilter::convertFilterIDToName (SignalFilter::FILTER_ABS_BANDLIMIT)); string sOptFilterMethodName (ProcessSignal::convertFilterMethodIDToName (ProcessSignal::FILTER_METHOD_CONVOLUTION)); @@ -207,7 +207,7 @@ pjrec_main (int argc, char * argv[]) bOptDebug = true; break; case O_TRACE: - if ((optTrace = TraceLevel::convertTraceNameToID(optarg)) == TRACE_INVALID) { + if ((optTrace = Trace::convertTraceNameToID(optarg)) == Trace::TRACE_INVALID) { pjrec_usage(argv[0]); return (1); } @@ -260,8 +260,11 @@ pjrec_main (int argc, char * argv[]) #ifdef HAVE_MPI if (mpiWorld.getRank() == 0) { projGlobal.read (pszFilenameProj); - if (bOptVerbose) - projGlobal.printScanInfo(); + if (bOptVerbose) { + ostringstream os; + projGlobal.printScanInfo (os); + cout << os.str(); + } mpi_ndet = projGlobal.nDet(); mpi_nview = projGlobal.nView(); @@ -310,15 +313,25 @@ pjrec_main (int argc, char * argv[]) imLocal = new ImageFile (nx, ny); #else projGlobal.read (pszFilenameProj); - if (bOptVerbose) - projGlobal.printScanInfo(); + if (bOptVerbose) { + ostringstream os; + projGlobal.printScanInfo(os); + cout << os.str(); + } imGlobal = new ImageFile (nx, ny); #endif #ifdef HAVE_MPI TimerCollectiveMPI timerReconstruct (mpiWorld.getComm()); - projLocal.reconstruct (*imLocal, sOptFilterName.c_str(), dOptFilterParam, sOptFilterMethodName.c_str(), iOptZeropad, sOptFilterGenerationName.c_str(), sOptInterpName.c_str(), iOptPreinterpolationFactor, sOptBackprojectName.c_str(), optTrace); + + Reconstructor reconstruct (projLocal, *imLocal, sOptFilterName.c_str(), dOptFilterParam, sOptFilterMethodName.c_str(), iOptZeropad, sOptFilterGenerationName.c_str(), sOptInterpName.c_str(), iOptPreinterpolationFactor, sOptBackprojectName.c_str(), optTrace); + if (reconstruct.fail()) { + cout << reconstruct.failMessage(); + return (1); + } + reconstruct.reconstructAllViews(); + if (bOptVerbose) timerReconstruct.timerEndAndReport ("Time to reconstruct"); @@ -327,7 +340,12 @@ pjrec_main (int argc, char * argv[]) if (bOptVerbose) timerReduce.timerEndAndReport ("Time to reduce image"); #else - projGlobal.reconstruct (*imGlobal, sOptFilterName.c_str(), dOptFilterParam, sOptFilterMethodName.c_str(), iOptZeropad, sOptFilterGenerationName.c_str(), sOptInterpName.c_str(), iOptPreinterpolationFactor, sOptBackprojectName.c_str(), optTrace); + Reconstructor reconstruct (projGlobal, *imGlobal, sOptFilterName.c_str(), dOptFilterParam, sOptFilterMethodName.c_str(), iOptZeropad, sOptFilterGenerationName.c_str(), sOptInterpName.c_str(), iOptPreinterpolationFactor, sOptBackprojectName.c_str(), optTrace); + if (reconstruct.fail()) { + cout << reconstruct.failMessage(); + return (1); + } + reconstruct.reconstructAllViews(); #endif #ifdef HAVE_MPI