r10877: Automated commit for Debian build of ctsim upstream-version-4.4.3
[ctsim.git] / tools / pjrec.cpp
index 24ee087e5b76cb3702a86d10756de59bfae3088d..974d62e88b8408225c8859fe62588ce4459ca2fd 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: pjrec.cpp,v 1.22 2001/02/09 14:34:16 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
@@ -48,7 +48,7 @@ static struct option my_options[] =
   {0, 0, 0, 0}
 };
 
-static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.22 2001/02/09 14:34:16 kevin Exp $";
+static const char* g_szIdStr = "$Id$";
 
 void 
 pjrec_usage (const char *program)
@@ -74,12 +74,14 @@ pjrec_usage (const char *program)
   std::cout << "    abs_sinc       Abs * Sinc" << std::endl;
   std::cout << "    abs_cosine     Abs * Cosine" << std::endl;
   std::cout << "    abs_hamming    Abs * Hamming" << std::endl;
+  std::cout << "    abs_hanning    Abs * Hanning" << std::endl;
   std::cout << "    shepp          Shepp-Logan" << std::endl;
   std::cout << "    bandlimit      Bandlimiting" << std::endl;
   std::cout << "    sinc           Sinc" << std::endl;
   std::cout << "    cosine         Cosine" << std::endl;
   std::cout << "    triangle       Triangle" << std::endl;
   std::cout << "    hamming        Hamming" << std::endl;
+  std::cout << "    hanning        Hanning" << std::endl;
   std::cout << "  --filter-method  Filter method before backprojections\n";;
   std::cout << "    convolution      Spatial filtering (default)\n";
   std::cout << "    fourier          Frequency filtering with discete fourier\n";
@@ -98,17 +100,11 @@ pjrec_usage (const char *program)
   std::cout << "    trig        Trigometric functions at every point" << std::endl;
   std::cout << "    table       Trigometric functions with precalculated table" << std::endl;
   std::cout << "    diff        Difference method" << std::endl;
-  std::cout << "    diff2       Optimized difference method (default)" << std::endl;
-  std::cout << "    idiff2      Optimized difference method with integer math" << std::endl;
-  std::cout << "    idiff3      Highly-optimized difference method with integer math" << std::endl;
+  std::cout << "    idiff       Difference method with integer math [default]" << std::endl;
   std::cout << "  --filter-param Alpha level for Hamming filter" << std::endl;
   std::cout << "  --trace        Set tracing to level" << std::endl;
   std::cout << "     none        No tracing (default)" << std::endl;
   std::cout << "     console     Text level tracing" << std::endl;
-  std::cout << "     phantom     Trace phantom" << std::endl;
-  std::cout << "     proj        Trace allrays" << std::endl;
-  std::cout << "     plot        Trace plotting" << std::endl;
-  std::cout << "     clipping    Trace clipping" << std::endl;
   std::cout << "  --verbose      Turn on verbose mode" << std::endl;
   std::cout << "  --debug        Turn on debug mode" << std::endl;
   std::cout << "  --version      Print version" << std::endl;
@@ -139,7 +135,7 @@ pjrec_main (int argc, char * const argv[])
   std::string sOptFilterMethodName (ProcessSignal::convertFilterMethodIDToName (ProcessSignal::FILTER_METHOD_CONVOLUTION));
   std::string sOptFilterGenerationName (ProcessSignal::convertFilterGenerationIDToName (ProcessSignal::FILTER_GENERATION_DIRECT));
   std::string sOptInterpName (Backprojector::convertInterpIDToName (Backprojector::INTERP_LINEAR));
-  std::string sOptBackprojectName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF3));
+  std::string sOptBackprojectName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF));
   int iOptPreinterpolationFactor = 1;
   int nx, ny;
   char *endptr;
@@ -312,7 +308,12 @@ pjrec_main (int argc, char * const argv[])
 
   imLocal = new ImageFile (nx, ny);
 #else
-  projGlobal.read (pszFilenameProj);
+
+  if (! projGlobal.read (pszFilenameProj)) {
+    fprintf(stderr, "Unable to read projectfile file %s\n", pszFilenameProj);
+    exit(1);
+  }
+
   if (bOptVerbose) {
     std::ostringstream os;
     projGlobal.printScanInfo(os);
@@ -331,7 +332,7 @@ pjrec_main (int argc, char * const argv[])
     return (1);
   }
   reconstruct.reconstructAllViews();
-
+  
   if (bOptVerbose)
       timerReconstruct.timerEndAndReport ("Time to reconstruct");