** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: pjrec.cpp,v 1.12 2000/08/19 22:59:06 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
{0, 0, 0, 0}
};
-static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.12 2000/08/19 22:59:06 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)
cout << " --filter Filter name" << endl;
cout << " abs_bandlimit Abs * Bandlimiting (default)" << endl;
cout << " abs_sinc Abs * Sinc" << endl;
- cout << " abs_cos Abs * Cosine" << endl;
+ cout << " abs_cosine Abs * Cosine" << endl;
cout << " abs_hamming Abs * Hamming" << endl;
cout << " shepp Shepp-Logan" << endl;
cout << " bandlimit Bandlimiting" << endl;
cout << " sinc Sinc" << endl;
- cout << " cos Cosine" << endl;
+ cout << " cosine Cosine" << endl;
cout << " triangle Triangle" << endl;
cout << " hamming Hamming" << endl;
cout << " --filter-method Filter method before backprojections\n";;
cout << " --zeropad n Set zeropad level (default = 0)\n";
cout << " set n to number of powers to two to pad\n";
cout << " --filter-generation Filter Generation mode\n";
- cout << " direct Use direct filter in spatial or frequency domain\n";
+ cout << " direct Use direct filter in spatial or frequency domain (default)\n";
cout << " inverse_fourier Use inverse fourier transform of inverse filter\n";
cout << " --backproj Backprojection Method" << endl;
cout << " trig Trigometric functions at every point" << endl;
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;
string sRemark;
bool bOptVerbose = false;
bool bOptDebug = 1;
- int iOptZeropad = 0;
- int optTrace = TRACE_NONE;
+ int iOptZeropad = 1;
+ int optTrace = Trace::TRACE_NONE;
double dOptFilterParam = -1;
string sOptFilterName (SignalFilter::convertFilterIDToName (SignalFilter::FILTER_ABS_BANDLIMIT));
string sOptFilterMethodName (ProcessSignal::convertFilterMethodIDToName (ProcessSignal::FILTER_METHOD_CONVOLUTION));
- string sOptFilterGenerationName (ProcessSignal::convertFilterGenerationIDToName (ProcessSignal::FILTER_GENERATION_INVERSE_FOURIER));
+ string sOptFilterGenerationName (ProcessSignal::convertFilterGenerationIDToName (ProcessSignal::FILTER_GENERATION_DIRECT));
string sOptInterpName (Backprojector::convertInterpIDToName (Backprojector::INTERP_LINEAR));
string sOptBackprojectName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF3));
int iOptPreinterpolationFactor = 1;
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);
}
#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();
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");
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