r92: *** empty log message ***
[ctsim.git] / src / ctrec.cpp
index ada1c10ce3c49c3c7a6a943f2c4c2762b0352079..19278c98bbeb2443c3de464edf6fdcb5b9bc59e4 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ctrec.cpp,v 1.6 2000/06/09 11:03:08 kevin Exp $
+**  $Id: ctrec.cpp,v 1.7 2000/06/10 22:33:11 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
@@ -46,48 +46,48 @@ static struct option my_options[] =
 void 
 ctrec_usage (const char *program)
 {
-  fprintf(stdout,"usage: %s raysum-file image-file nx-image ny-image [OPTIONS]\n", kbasename(program));
-  fprintf(stdout,"Image reconstruction from raysum projections\n");
-  fprintf(stdout,"\n");
-  fprintf(stdout,"   raysum-file     Input raysum file\n");
-  fprintf(stdout,"   image-file      Output image file in SDF2D format\n");
-  fprintf(stdout,"   nx-image        Number of columns in output image\n");
-  fprintf(stdout,"   ny-image        Number of rows in output image\n");
-  fprintf(stdout,"   --interp        Interpolation method during backprojection\n");
-  fprintf(stdout,"       nearest     Nearest neighbor interpolation\n");
-  fprintf(stdout,"       linear      Linear interpolation\n");
+    cout << "usage: " << kbasename(program) << " raysum-file image-file nx-image ny-image [OPTIONS]" << endl;
+  cout << "Image reconstruction from raysum projections" << endl;
+  cout << endl;
+  cout << "   raysum-file     Input raysum file" << endl;
+  cout << "   image-file      Output image file in SDF2D format" << endl;
+  cout << "   nx-image        Number of columns in output image" << endl;
+  cout << "   ny-image        Number of rows in output image" << endl;
+  cout << "   --interp        Interpolation method during backprojection" << endl;
+  cout << "       nearest     Nearest neighbor interpolation" << endl;
+  cout << "       linear      Linear interpolation" << endl;
 #if HAVE_BSPLINE_INTERP
-  fprintf(stdout,"       bspline     B-spline interpolation\n");
+  cout << "       bspline     B-spline interpolation" << endl;
 #endif
-  fprintf(stdout,"    --filter       Filter name\n");
-  fprintf(stdout,"       abs_bandlimit Abs * Bandlimiting (default)\n");
-  fprintf(stdout,"       abs_sinc      Abs * Sinc\n");
-  fprintf(stdout,"       abs_cos       Abs * Cosine\n");
-  fprintf(stdout,"       abs_hamming   Abs * Hamming\n");
-  fprintf(stdout,"       shepp         Shepp-Logan\n");
-  fprintf(stdout,"       bandlimit     Bandlimiting\n");
-  fprintf(stdout,"       sinc          Sinc\n");
-  fprintf(stdout,"       cos           Cosine\n");
-  fprintf(stdout,"       triangle      Triangle\n");
-  fprintf(stdout,"       hamming       Hamming\n");
-  fprintf(stdout,"    --backproj     Backprojection Method\n");
-  fprintf(stdout,"       trig        Trigometric functions at every point\n");
-  fprintf(stdout,"       table       Trigometric functions with precalculated table\n");
-  fprintf(stdout,"       diff        Difference method\n");
-  fprintf(stdout,"       diff2       Optimized difference method (default)\n");
-  fprintf(stdout,"       idiff2      Optimized difference method with integer math\n");
-  fprintf(stdout,"    --filter-param Alpha level for Hamming filter\n");
-  fprintf(stdout,"    --trace        Set tracing to level\n");
-  fprintf(stdout,"         none      No tracing (default)\n");
-  fprintf(stdout,"         text      Text level tracing\n");
-  fprintf(stdout,"         phm       Trace phantom\n");
-  fprintf(stdout,"         rays      Trace allrays\n");
-  fprintf(stdout,"         plot      Trace plotting\n");
-  fprintf(stdout,"         clipping  Trace clipping\n");
-  fprintf(stdout,"    --verbose      Turn on verbose mode\n");
-  fprintf(stdout,"    --debug        Turn on debug mode\n");
-  fprintf(stdout,"    --version      Print version\n");
-  fprintf(stdout,"    --help         Print this help message\n");
+  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_hamming   Abs * Hamming" << endl;
+  cout << "       shepp         Shepp-Logan" << endl;
+  cout << "       bandlimit     Bandlimiting" << endl;
+  cout << "       sinc          Sinc" << endl;
+  cout << "       cos           Cosine" << endl;
+  cout << "       triangle      Triangle" << endl;
+  cout << "       hamming       Hamming" << endl;
+  cout << "    --backproj     Backprojection Method" << endl;
+  cout << "       trig        Trigometric functions at every point" << endl;
+  cout << "       table       Trigometric functions with precalculated table" << endl;
+  cout << "       diff        Difference method" << endl;
+  cout << "       diff2       Optimized difference method (default)" << endl;
+  cout << "       idiff2      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 << "    --verbose      Turn on verbose mode" << endl;
+  cout << "    --debug        Turn on debug mode" << endl;
+  cout << "    --version      Print version" << endl;
+  cout << "    --help         Print this help message" << endl;
 }
 
 
@@ -95,7 +95,6 @@ ctrec_usage (const char *program)
 static void mpi_scatter_rs (MPIWorld& mpiWorld, RAYSUM *rs_global, RAYSUM *rs_local, const int debug);
 #endif
 
-static void print_raysum_info(const RAYSUM *rs);
 
 int 
 ctrec_main (int argc, char * argv[])
@@ -181,9 +180,9 @@ ctrec_main (int argc, char * argv[])
          break;
         case O_VERSION:
 #ifdef VERSION
-         fprintf(stdout, "Version %s\n", VERSION);
+       cout <<  "Version " <<  VERSION << endl;
 #else
-         fprintf(stderr, "Unknown version number");
+        cout << "Unknown version number" << endl;
 #endif
          exit(0);
        case O_HELP:
@@ -228,7 +227,7 @@ ctrec_main (int argc, char * argv[])
     rs_global = raysum_open (rs_name);
     raysum_read (rs_global);
     if (opt_verbose)
-      print_raysum_info(rs_global);
+      raysum_print_info(rs_global);
 
     mpi_ndet = rs_global->ndet;
     mpi_nview = rs_global->nview;
@@ -264,7 +263,6 @@ ctrec_main (int argc, char * argv[])
   mpiWorld.setTotalWorkUnits (mpi_nview);
 
   rs_local = raysum_create (NULL, mpiWorld.getMyLocalWorkUnits(), mpi_ndet);
-
   rs_local->ndet = mpi_ndet;
   rs_local->nview = mpi_nview;
   rs_local->det_inc = mpi_detinc;
@@ -292,7 +290,7 @@ ctrec_main (int argc, char * argv[])
   rs_global = raysum_open (rs_name);
   raysum_read (rs_global);
   if (opt_verbose)
-    print_raysum_info(rs_global);
+    raysum_print_info(rs_global);
 
   im_global = new ImageFile (im_filename, nx, ny);
   im_global->fileCreate();
@@ -346,7 +344,6 @@ ctrec_main (int argc, char * argv[])
   time_end = td_current_sec();
 #endif
 
-
 #ifdef HAVE_MPI
   if (mpiWorld.getRank() == 0)
 #endif
@@ -368,7 +365,6 @@ ctrec_main (int argc, char * argv[])
        return (0);
 }
 
-
 #ifdef HAVE_MPI
 static void mpi_scatter_rs (MPIWorld& mpiWorld, RAYSUM *rs_global, RAYSUM *rs_local, const int opt_debug)
 {
@@ -394,18 +390,6 @@ static void mpi_scatter_rs (MPIWorld& mpiWorld, RAYSUM *rs_global, RAYSUM *rs_lo
 
 #endif
 
-static void print_raysum_info(const RAYSUM *rs)
-{
-  printf ("Number of detectors: %d\n", rs->ndet);
-  printf ("    Number of views: %d\n", rs->nview);
-  printf ("             Remark: %s\n", rs->remark);
-  printf ("             phmlen: %f\n", rs->phmlen);
-  printf ("          det_start: %f\n", rs->det_start);
-  printf ("            det_inc: %f\n", rs->det_inc);
-  printf ("          rot_start: %f\n", rs->rot_start);
-  printf ("            rot_inc: %f\n", rs->rot_inc);
-}
-
 #ifndef NO_MAIN
 int 
 main (int argc, char* argv[])