r129: *** empty log message ***
[ctsim.git] / src / pjrec.cpp
index b5760a79361252a0047751acdc2e2cc5537b2906..0a2b2c84ae47bf65d7debc251f9839774b04229f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: pjrec.cpp,v 1.1 2000/06/26 21:15:24 kevin Exp $
+**  $Id: pjrec.cpp,v 1.5 2000/07/04 18:33:35 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
 #include "timer.h"
 
 
-enum {O_INTERP, O_FILTER, O_FILTER_PARAM, O_BACKPROJ, O_VERBOSE, O_TRACE, O_HELP, O_DEBUG, O_VERSION};
+enum {O_INTERP, O_FILTER, O_FILTER_METHOD, O_FILTER_PARAM, O_BACKPROJ, O_VERBOSE, O_TRACE, O_HELP, O_DEBUG, O_VERSION};
 
 static struct option my_options[] =
 {
   {"interp", 1, 0, O_INTERP},
   {"filter", 1, 0, O_FILTER},
+  {"filter-method", 1, 0, O_FILTER_METHOD},
   {"filter-param", 1, 0, O_FILTER_PARAM},
   {"backproj", 1, 0, O_BACKPROJ},
   {"trace", 1, 0, O_TRACE},
@@ -73,6 +74,9 @@ pjrec_usage (const char *program)
   cout << "       cos           Cosine" << endl;
   cout << "       triangle      Triangle" << endl;
   cout << "       hamming       Hamming" << endl;
+  cout << "    --filter-method  Filter method before backprojections\n";;
+  cout << "       convolution      Spatial filtering (default)\n";
+  cout << "       fourier          Frequency filtering with discete fourier\n";
   cout << "    --backproj     Backprojection Method" << endl;
   cout << "       trig        Trigometric functions at every point" << endl;
   cout << "       table       Trigometric functions with precalculated table" << endl;
@@ -114,6 +118,7 @@ pjrec_main (int argc, char * argv[])
   int optTrace = TRACE_NONE;
   double optFilterParam = -1;
   string optFilterName = SignalFilter::FILTER_ABS_BANDLIMIT_STR;
+  string optFilterMethodName = SignalFilter::FILTER_METHOD_CONVOLUTION_STR;
   string optInterpName = Backprojector::INTERP_LINEAR_STR;
   string optBackprojName = Backprojector::BPROJ_IDIFF2_STR;
   //  string optFilterMethodName = SignalFilter::FILTER_METHOD_CONVOLUTION_STR;
@@ -146,6 +151,9 @@ pjrec_main (int argc, char * argv[])
        case O_FILTER:
          optFilterName = optarg;
          break;
+        case O_FILTER_METHOD:
+         optFilterMethodName = optarg;
+          break;
        case O_BACKPROJ:
          optBackprojName = optarg;
          break;
@@ -271,7 +279,7 @@ pjrec_main (int argc, char * argv[])
 
 #ifdef HAVE_MPI
   TimerCollectiveMPI timerReconstruct (mpiWorld.getComm());
-  projLocal.reconstruct (*imLocal, optFilterName.c_str(), optFilterParam, optInterpName.c_str(), optInterpParam, optBackprojName.c_str(), optTrace);
+  projLocal.reconstruct (*imLocal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optInterpName.c_str(), optInterpParam, optBackprojName.c_str(), optTrace);
   if (optVerbose)
       timerReconstruct.timerEndAndReport ("Time to reconstruct");
 
@@ -280,7 +288,7 @@ pjrec_main (int argc, char * argv[])
   if (optVerbose)
       timerReduce.timerEndAndReport ("Time to reduce image");
 #else
-  projGlobal.reconstruct (*imGlobal, optFilterName.c_str(), optFilterParam, optInterpName.c_str(), optInterpParam, optBackprojName.c_str(), optTrace);
+  projGlobal.reconstruct (*imGlobal, optFilterName.c_str(), optFilterParam, optFilterMethodName.c_str(), optInterpName.c_str(), optInterpParam, optBackprojName.c_str(), optTrace);
 #endif
 
 #ifdef HAVE_MPI
@@ -288,7 +296,7 @@ pjrec_main (int argc, char * argv[])
 #endif
     {
       double calcTime = timerProgram.timerEnd();
-      imGlobal->labelAdd (Array2dFileLabel::L_HISTORY, projGlobal.remark(), projGlobal.calcTime());
+      imGlobal->labelAdd (projGlobal.getLabel());
       imGlobal->labelAdd (Array2dFileLabel::L_HISTORY, remark.c_str(), calcTime);
       imGlobal->fileWrite (filenameImage);
       if (optVerbose)