r92: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 10 Jun 2000 22:33:11 +0000 (22:33 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 10 Jun 2000 22:33:11 +0000 (22:33 +0000)
ChangeLog
acconfig.h
config.h.in
configure.in
include/imagefile.h
include/ir.h
src/ctrec.cpp

index e4606bd99bd663885b6f79af894bc36f1631d3c9..c255cc0d36b0c46e2bdd515f7393ab2c6d40b553 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
+0.6.0-b3 - 6/10/2000
+   Improved Integer backprojection method
+       Fixed nearest neighbor to be truly nearest neighbor
+       Made linear interpolation more integer arithmetic -> speed improvement
+       
 0.6.0-b2 - 6/8/2000
    Converted MPI data structures to C++ object
+   Made ImageFile directly inherit from Array2dFile
        
 0.6.0-b1 - 6/6/2000
    First C++ conversions
index d93656c14462748043f21d524a22c81538c469f8..69da21fdfe7c87662aa42be8d51b663c469e455b 100644 (file)
@@ -60,3 +60,5 @@
 
 /* Define for X11 library */
 #undef HAVE_X11
+
+#undef HAVE_WXWINDOWS
index 1d09dc5739c46c6c18683c4ad5dd1e04ab94855b..377a0fdad5d9f4b32e9173c319328575c32efa41 100644 (file)
@@ -52,6 +52,8 @@
 /* Define for X11 library */
 #undef HAVE_X11
 
+#undef HAVE_WXWINDOWS
+
 /* The number of bytes in a double.  */
 #undef SIZEOF_DOUBLE
 
index dcf7aee15388473dbe2d0b137ceb61c82c01a39e..9e32c1f9c041b309e960c74723d20abeb58b8df1 100644 (file)
@@ -77,8 +77,8 @@ AC_CHECK_LIB(m, main)
 AC_CHECK_LIB(curses, main, [curses=true], [curses=false])
 AC_CHECK_LIB(ncurses, main, [ncurses=true], [ncurses=false])
 AC_CHECK_LIB(g2, main, [g2=true], [g2=false])
-AC_CHECK_LIB(wx_gtk, main, [wxwin=true; wx_gtk=true], [wxwin=false])
-AC_CHECK_LIB(wx_msw, main, [wxwin=true; wx_msw=true], [wxwin=false])
+AC_CHECK_LIB(wx_gtk, main, [wxwin=true; wx_gtk=true; AC_DEFINE(HAVE_WXWINDOWS)], [wxwin=false])
+AC_CHECK_LIB(wx_msw, main, [wxwin=true; wx_msw=true; AC_DEFINE(HAVE_WXWINDOWS)], [wxwin=false])
 
 if test "$zlib" = "true" ; then
   AC_CHECK_LIB(png, main, [png=true ; AC_DEFINE(HAVE_PNG)], [png=false])
@@ -285,34 +285,33 @@ if test "$no_x" != "yes" ; then
   AC_DEFINE(HAVE_SGP)
   AM_CONDITIONAL(HAVE_SGP, test 1==1)
   LDFLAGS="$LDFLAGS -L../libezplot -L../libgraph -L/usr/X11R6/lib"
-  ctlibs_base="$ctlibs_base -lezplot -lgraph $X_BASIC_LIBS $X_TOOLKIT_LIBS"
+  ctlibs_graphics="$ctlibs_base -lezplot -lgraph $X_BASIC_LIBS $X_TOOLKIT_LIBS"
   AC_MSG_RESULT(yes)
 else
   AC_MSG_RESULT(no)
 fi
 
-dnl Setting projet libraries and includes
-LDFLAGS="$LDFLAGS -L../libkmath -L../libk -L../libcio -L../libir" 
-ctlibs_base="$ctlibs_base -lkmath -lk -lcio"
 if test "$png" = "true" ; then
-  ctlibs_base="$ctlibs_base -lpng"
+  ctlibs_graphics="$ctlibs_graphics -lpng"
 fi
 if test "$zlib" = "true" ; then
-  ctlibs_base="$ctlibs_base -lz"
+  ctlibs_graphics="$ctlibs_graphics -lz"
 fi
 if test "$g2" = "true" ; then
-  ctlibs_base="$ctlibs_base -lg2"
+  ctlibs_graphics="$ctlibs_graphics -lg2"
+fi
+if test "$wx_gtk" = "true" ; then
+  ctlibs_graphics="$ctlibs_graphics -lwx_gtk"
 fi
 
-ctlibs="-lir $ctlibs_base"
-
+dnl Setting projet libraries and includes
+LDFLAGS="$LDFLAGS -L../libkmath -L../libk -L../libcio -L../libir" 
+ctlibs="$ctlibs_base -lir $ctlibs_graphics -lkmath -lk -lcio"
 AC_SUBST(ctlibs)
 
 if test -n "$lamdir" ; then
-dnl  ctlamlibs="-lir_lam $ctlibs_base"
-dnl  AC_SUBST(ctlamlibs)
   lamprograms="ctrec-lam phm2if-lam phm2rs-lam"
   AC_SUBST(lamprograms)
- fi
+fi
 
 AC_OUTPUT(Makefile libezplot/Makefile src/Makefile libgraph/Makefile libkmath/Makefile Makefile libk/Makefile libir/Makefile libcio/Makefile man/Makefile cgi-bin/ctsim.cgi cgi-bin/Makefile html/simulate.html html/Makefile include/Makefile getopt/Makefile src/sample-ctrec.sh cgi-bin/ctsim.conf)
index 7c0952c2acc568e8b96897a011637ac77074baa5..70c3fe40b4f914b1364fd33c235a81f7cc1b83c1 100644 (file)
@@ -13,6 +13,8 @@ class Array2dFileLabel
 {
 private:
     void init (void);
+    Array2dFileLabel (const Array2dFileLabel&);
+    Array2dFileLabel& operator= (const Array2dFileLabel&);
 
 public:
     kfloat64 calc_time;
@@ -88,6 +90,9 @@ private:
   kuint32 mNX;
   kuint32 mNY;
 
+  Array2dFile (const Array2dFile&);
+  Array2dFile& operator= (const Array2dFile&);
+
 public:
 
   Array2d<T> array;
index cadc91b8b465f58472e083d9a55f55e8c08a7fe8..9c8f92e8dc5fe1b9d8379a2b505d9862094523c6 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ir.h,v 1.24 2000/06/09 01:35:33 kevin Exp $
+**  $Id: ir.h,v 1.25 2000/06/10 22:33:11 kevin Exp $
 **
 **
 **  This program is free software; you can redistribute it and/or modify
@@ -364,11 +364,12 @@ int raysum_read_header(RAYSUM *rs);
 int raysum_write_header(RAYSUM *rs);
 int raysum_read(RAYSUM *rs);
 int raysum_write(RAYSUM *rs);
+void raysum_print(const RAYSUM *rs);
+void raysum_print_info(const RAYSUM *rs);
 DETARRAY *detarray_alloc(const int n);
 void detarray_free(DETARRAY *darray);
 int detarray_read(RAYSUM *rs, DETARRAY *darray, const int view_num);
 int detarray_write(RAYSUM *rs, const DETARRAY *darray, const int view_num);
-int raysum_print(const RAYSUM *rs);
 
 /* From phm2image.cpp */
 void phm_to_imagefile (const PHANTOM *phm, ImageFile& im, const int col_start, const int col_count, const int nsample, const int trace);
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[])