r140: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 9 Jul 2000 08:16:18 +0000 (08:16 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 9 Jul 2000 08:16:18 +0000 (08:16 +0000)
19 files changed:
ChangeLog
acconfig.h
cgi-bin/ctsim.cgi.in
config.h.in
configure
configure.in
html/simulate.html.in
include/array2dfile.h
include/backprojectors.h
include/ct.h
libctsim/Makefile.am
libctsim/array2dfile.cpp
libctsim/backprojectors.cpp
src/Makefile.am
src/if-2.cpp
src/if2img.cpp
src/ifinfo.cpp
src/pjrec.cpp
src/sample-ctsim.sh.in

index b79ebf17807f31e873950806ae21a373527b87cd..055fcff298ab21a0cdb08754e7ef657b15d7c12c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2.0.0-b3 - 7/09/00
    Added highly optimized backprojection method idiff3
+   Moved comparative stats to if-2 program from ifinfo
        
 2.0.0-b2 - 7/07/00
    Cleaned up SignalFilter class
index 8d68fc0a67647b0643c2514264ee4bcb2d1a231d..a1ed6a622cb9f751fd01c382b38255222398fbed 100644 (file)
@@ -64,3 +64,7 @@
 #undef HAVE_WXWINDOWS
 
 #undef HAVE_FFTW
+
+#undef DEBUG
+
+#undef NDEBUG
index 8c9190b003ed0bd8eed36b227c7973f40df98f2a..959d69b5c6fafce2991de45b0fdc823c515c33ef 100755 (executable)
@@ -84,23 +84,22 @@ my $phantom_fname = "$::datadir/phantom-$tmpid.if";
 my $pj_fname = "$::datadir/pj-$tmpid.pj";
 my $ir_fname = "$::datadir/ir-$tmpid.if";
 my $pj_if_fname = "$::datadir/pj-$tmpid.if";
-my $diff_fname = "$::datadir/diff-$tmpid.if";
+my $sub_fname = "$::datadir/sub-$tmpid.if";
 my $phantom_png = "$::datadir/phantom-$tmpid.png";
 my $ir_png = "$::datadir/ir-$tmpid.png";
 my $pj_png = "$::datadir/pj-$tmpid.png";
-my $diff_png = "$::datadir/diff-$tmpid.png";
+my $sub_png = "$::datadir/sub-$tmpid.png";
 
 my $result_url = "$::url_datadir/result-$tmpid.html";
 my $phantom_png_url = "$::url_datadir/phantom-$tmpid.png";
 my $ir_png_url = "$::url_datadir/ir-$tmpid.png";
 my $pj_png_url = "$::url_datadir/pj-$tmpid.png";
-my $diff_png_url = "$::url_datadir/diff-$tmpid.png";
+my $sub_png_url = "$::url_datadir/sub-$tmpid.png";
 
 my $pjrec_ver = "$::bindir/pjrec";
 my $phm2pj_ver = "$::bindir/phm2pj";
 my $phm2if_ver = "$::bindir/phm2if";
 my $diff_ver = "$::bindir/if-2";
-my $ifinfo_ver = "$::bindir/ifinfo";
 
 $pjrec_ver = "/opt/lam/bin/mpirun N N $::lamrundir/pjrec-lam" if $MPI;
 $phm2pj_ver = "/opt/lam/bin/mpirun N N $::lamrundir/phm2pj-lam" if $MPI;
@@ -110,8 +109,8 @@ my $gp_cmd = "$phm2if_ver $phantom_fname $Phantom_Nx $Phantom_Ny --phantom $Phan
 my $pj_cmd = "$phm2pj_ver $pj_fname $PJ_NDet $PJ_NRot --phantom $Phantom_Name --nray $PJ_NRay --rotangle $PJ_RotAngle";
 my $pj_if_cmd = "$::bindir/pj2if $pj_fname $pj_if_fname";
 my $pjrec_cmd = "$pjrec_ver $pj_fname $ir_fname $IR_Nx $IR_Ny --filter $IR_Filter --filter-param $IR_Filter_Param --interp $IR_Interp --backproj $IR_Backproj --filter-method $IR_FilterMethod --zeropad $IR_Zeropad";
-my $diff_cmd = "$diff_ver $phantom_fname $ir_fname $diff_fname --comp";
-my $compare_cmd = "$ifinfo_ver $phantom_fname $ir_fname";
+my $sub_cmd = "$diff_ver $phantom_fname $ir_fname $sub_fname --sub";
+my $diff_cmd = "$diff_ver $phantom_fname $ir_fname --comp";
 
 my $window_options = "--auto $auto_window_img";
 if ($Disp_Min ne 'auto') {
@@ -124,7 +123,7 @@ if ($Disp_Max ne 'auto') {
 my $png1_cmd = "$::bindir/if2img $phantom_fname $phantom_png $window_options --stats --format png";
 my $png2_cmd = "$::bindir/if2img $ir_fname $ir_png $window_options --stats --format png";
 my $png3_cmd = "$::bindir/if2img $pj_if_fname $pj_png --auto $auto_window_pj --stats --format png";
-my $png4_cmd = "$::bindir/if2img $diff_fname $diff_png --auto $auto_window_diff --stats --format png";
+my $png4_cmd = "$::bindir/if2img $sub_fname $sub_png --auto $auto_window_diff --stats --format png";
 
 my $title = "CT Simulation Results";
 
@@ -149,12 +148,12 @@ if ($error ne "") {
   my $pj_out;
   my $pj_if_out;
   my $pjrec_out;
+  my $sub_out;
   my $diff_out;
   my $png_gp_out;
   my $png_pjrec_out;
   my $png_pj_out;
-  my $png_diff_out;
-  my $compare_out;
+  my $png_sub_out;
   $gp_out = `$gp_cmd`;
   if (-s $phantom_fname) {
     $pj_out .= `$pj_cmd`;
@@ -165,14 +164,14 @@ if ($error ne "") {
       $pjrec_out .= `$pjrec_cmd`;
       if (-s $ir_fname) {
        $png_pjrec_out .= `$png2_cmd`;
+       $sub_out .= `$sub_cmd`;
        $diff_out .= `$diff_cmd`;
-       $png_diff_out .= `$png4_cmd`;
-       $compare_out = `$compare_cmd`;
+       $png_sub_out .= `$png4_cmd`;
       }
     }
   }
 
-  $cmdout = "$gp_cmd\n $gp_out $pj_cmd\n $pj_out $pj_if_cmd\n $pj_if_out $pjrec_cmd\n $pjrec_out $diff_cmd\n $diff_out $png1_cmd\n $png_gp_out $png2_cmd\n $png_pjrec_out $png3_cmd\n $png_pj_out $png4_cmd\n $png_diff_out";
+  $cmdout = "$gp_cmd\n $gp_out $pj_cmd\n $pj_out $pj_if_cmd\n $pj_if_out $pjrec_cmd\n $pjrec_out $diff_cmd\n $diff_out $png1_cmd\n $png_gp_out $png2_cmd\n $png_pjrec_out $png3_cmd\n $png_pj_out $png4_cmd\n $png_sub_out";
   if (open(LOGFILE,">> $logfile")) {
     flock(LOGFILE,LOCK_EX);
     seek(LOGFILE, 0, 2);
@@ -190,21 +189,21 @@ if ($error ne "") {
   my $png_gp_out_html = $png_gp_out;
   my $png_pjrec_out_html = $png_pjrec_out;
   my $png_pj_out_html = $png_pj_out;
-  my $png_diff_out_html = $png_diff_out;
+  my $png_sub_out_html = $png_sub_out;
   $png_gp_out_html =~ s/\n/<br>/gms;
   $png_pjrec_out_html =~ s/\n/<br>/gms;
   $png_pj_out_html =~ s/\n/<br>/gms;
-  $png_diff_out_html =~ s/\n/<br>/gms;
+  $png_sub_out_html =~ s/\n/<br>/gms;
   $out .= "<TABLE><TR><TD>Phantom Image</TD><TD>Reconstructed Image</TD></TR>\n";
   $out .= "<TR><TD><IMG SRC=\"$phantom_png_url\"><br><FONT SIZE=1>$png_gp_out</FONT></TD>\n";
   $out .= "<TD><IMG SRC=\"$ir_png_url\"><br><FONT SIZE=1>$png_pjrec_out</FONT></TD></TR>\n";
   $out .= "<TR><TD>Projection Sinusoid</TD><TD>Phantom/Reconst Error</TD></TR>\n";
   $out .= "<TR><TD><IMG SRC=\"$pj_png_url\"><br><FONT SIZE=1>$png_pj_out</FONT></TD>\n";
-  $out .= "<TD><IMG SRC=\"$diff_png_url\"><br><FONT SIZE=2>$diff_out</FONT><br><FONT SIZE=1>$png_diff_out</FONT></TD></TR>\n";
+  $out .= "<TD><IMG SRC=\"$sub_png_url\"><br><FONT SIZE=2>$sub_out</FONT><br><FONT SIZE=1>$png_sub_out</FONT></TD></TR>\n";
   $out .= "</TABLE>";
   $out .= "Execution time: $execution_time seconds\n";
   $out .= "<p>\nStatistics<br>";
-  $out .= "$compare_out";
+  $out .= "$diff_out";
 }
 
 $out .= "<HR>\n";
index 1a9d08d077ea98241ebf85c421ba79b6c855cf9b..a4a5146267c3ed993c5e4aaeeffaf5ee00575c9b 100644 (file)
 
 #undef HAVE_FFTW
 
+#undef DEBUG
+
+#undef NDEBUG
+
 /* The number of bytes in a double.  */
 #undef SIZEOF_DOUBLE
 
@@ -89,6 +93,9 @@
 /* Define if you have the <X11/extensions/multibuf.h> header file.  */
 #undef HAVE_X11_EXTENSIONS_MULTIBUF_H
 
+/* Define if you have the <assert.h> header file.  */
+#undef HAVE_ASSERT_H
+
 /* Define if you have the <ctype.h> header file.  */
 #undef HAVE_CTYPE_H
 
index 889edc6163ba8fd8c12947d0bc3d656083ec479e..2b9a3c6ccead6cb165f7845786e03bd6cf53d62d 100755 (executable)
--- a/configure
+++ b/configure
@@ -710,7 +710,7 @@ fi
 
 PACKAGE=ctsim
 
-VERSION=2.0.0-b2
+VERSION=2.0.0-b3
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -2257,7 +2257,7 @@ EOF
 
 fi
 
-for ac_hdr in fcntl.h unistd.h getopt.h sys/fcntl.h setjmp.h stdarg.h stddef.h sys/types.h sys/stat.h string.h ctype.h math.h stdio.h netinet/in.h inttypes.h sys/param.h stdint.h stdlib.h g2.h
+for ac_hdr in fcntl.h unistd.h getopt.h sys/fcntl.h setjmp.h stdarg.h stddef.h sys/types.h sys/stat.h string.h ctype.h math.h stdio.h netinet/in.h inttypes.h sys/param.h stdint.h stdlib.h g2.h assert.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -2865,18 +2865,16 @@ if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
   case "${enableval}" in
   yes) debug=true 
-       CFLAGS="-g -DDEBUG"
        echo "$ac_t""yes" 1>&6
        ;;
   no)  debug=false 
        echo "$ac_t""no" 1>&6
-       CFLAGS="-g -O"
        ;;
   *) echo "$ac_t""bad value ${enableval} for --enable-debug" 1>&6 
        ;;
 esac
 else
-  debug=false
+  debug=false; echo "$ac_t""no" 1>&6
 fi
 
 
@@ -2889,6 +2887,20 @@ else
   DEBUG_FALSE=
 fi
 
+if test "$debug" = "true" ; then
+  CFLAGS="-g -DDEBUG"
+  cat >> confdefs.h <<\EOF
+#define DEBUG 1
+EOF
+
+else
+  CFLAGS="-g -O3 -DNDEBUG"
+  cat >> confdefs.h <<\EOF
+#define NDEBUG 1
+EOF
+
+fi
+
 # Check whether --with-lam or --without-lam was given.
 if test "${with_lam+set}" = set; then
   withval="$with_lam"
@@ -2905,7 +2917,7 @@ if test "$withval" != "no" ; then
   fi
 
   echo $ac_n "checking for LAM MPI installation""... $ac_c" 1>&6
-echo "configure:2909: checking for LAM MPI installation" >&5
+echo "configure:2921: checking for LAM MPI installation" >&5
   for testlamdir in "." $trylamdir /usr/local /usr/local/lam /usr /usr/lam /opt /opt/lam ; do
     if test -x "$testlamdir/bin/hcc" ; then
       LDFLAGS="$LDFLAGS -L$testlamdir/lib"
@@ -2923,7 +2935,7 @@ else
 fi
 
 echo $ac_n "checking for web access""... $ac_c" 1>&6
-echo "configure:2927: checking for web access" >&5
+echo "configure:2939: checking for web access" >&5
 # Check whether --with-cgibin-dir or --without-cgibin-dir was given.
 if test "${with_cgibin_dir+set}" = set; then
   withval="$with_cgibin_dir"
@@ -3013,7 +3025,7 @@ fi
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:3017: checking for X" >&5
+echo "configure:3029: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -3075,12 +3087,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 3079 "configure"
+#line 3091 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3149,14 +3161,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3153 "configure"
+#line 3165 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:3160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -3262,17 +3274,17 @@ else
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:3266: checking whether -R must be followed by a space" >&5
+echo "configure:3278: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 3269 "configure"
+#line 3281 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -3288,14 +3300,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 3292 "configure"
+#line 3304 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -3327,7 +3339,7 @@ rm -f conftest*
     # libraries were built with DECnet support.  And karl@cs.umb.edu says
     # the Alpha needs dnet_stub (dnet does not exist).
     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:3331: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:3343: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3335,7 +3347,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3339 "configure"
+#line 3351 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3346,7 +3358,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:3350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3368,7 +3380,7 @@ fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:3372: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:3384: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3376,7 +3388,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3380 "configure"
+#line 3392 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3387,7 +3399,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:3391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3416,12 +3428,12 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3420: checking for gethostbyname" >&5
+echo "configure:3432: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3425 "configure"
+#line 3437 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3444,7 +3456,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3465,7 +3477,7 @@ fi
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3469: checking for gethostbyname in -lnsl" >&5
+echo "configure:3481: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3473,7 +3485,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3477 "configure"
+#line 3489 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3484,7 +3496,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3514,12 +3526,12 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3518: checking for connect" >&5
+echo "configure:3530: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3523 "configure"
+#line 3535 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -3542,7 +3554,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -3563,7 +3575,7 @@ fi
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3567: checking for connect in -lsocket" >&5
+echo "configure:3579: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3571,7 +3583,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3575 "configure"
+#line 3587 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3582,7 +3594,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:3586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3606,12 +3618,12 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:3610: checking for remove" >&5
+echo "configure:3622: checking for remove" >&5
 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3615 "configure"
+#line 3627 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -3634,7 +3646,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -3655,7 +3667,7 @@ fi
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:3659: checking for remove in -lposix" >&5
+echo "configure:3671: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3663,7 +3675,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3667 "configure"
+#line 3679 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3674,7 +3686,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:3678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3698,12 +3710,12 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:3702: checking for shmat" >&5
+echo "configure:3714: checking for shmat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3707 "configure"
+#line 3719 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -3726,7 +3738,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -3747,7 +3759,7 @@ fi
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:3751: checking for shmat in -lipc" >&5
+echo "configure:3763: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3755,7 +3767,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3759 "configure"
+#line 3771 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3766,7 +3778,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:3770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3799,7 +3811,7 @@ fi
   # libraries we check for below, so use a different variable.
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:3803: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:3815: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3807,7 +3819,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3811 "configure"
+#line 3823 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3818,7 +3830,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:3822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3855,7 +3867,7 @@ X_BASIC_LIBS="-lXext -lX11"
 our_saved_LDFLAGS="$LDFLAGS"
 LDFLAGS="$X_LIBS $LDFLAGS"
 echo $ac_n "checking for XtToolkitThreadInitialize in -lXt""... $ac_c" 1>&6
-echo "configure:3859: checking for XtToolkitThreadInitialize in -lXt" >&5
+echo "configure:3871: checking for XtToolkitThreadInitialize in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtToolkitThreadInitialize | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3863,7 +3875,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt $X_PRE_LIBS $X_BASIC_LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3867 "configure"
+#line 3879 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3874,7 +3886,7 @@ int main() {
 XtToolkitThreadInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:3878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3902,7 +3914,7 @@ LDFLAGS="$our_saved_LDFLAGS"
 our_saved_LDFLAGS="$LDFLAGS"
 LDFLAGS="$X_LIBS $LDFLAGS"
 echo $ac_n "checking for XdbeQueryExtension in -lXext""... $ac_c" 1>&6
-echo "configure:3906: checking for XdbeQueryExtension in -lXext" >&5
+echo "configure:3918: checking for XdbeQueryExtension in -lXext" >&5
 ac_lib_var=`echo Xext'_'XdbeQueryExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3910,7 +3922,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXext -lX11 "$X_EXTRA_LIBS" $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3914 "configure"
+#line 3926 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3921,7 +3933,7 @@ int main() {
 XdbeQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:3925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3945,7 +3957,7 @@ else
 fi
 
 echo $ac_n "checking for XmbufQueryExtension in -lXext""... $ac_c" 1>&6
-echo "configure:3949: checking for XmbufQueryExtension in -lXext" >&5
+echo "configure:3961: checking for XmbufQueryExtension in -lXext" >&5
 ac_lib_var=`echo Xext'_'XmbufQueryExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3953,7 +3965,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXext -lX11 "$X_EXTRA_LIBS" $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3957 "configure"
+#line 3969 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3964,7 +3976,7 @@ int main() {
 XmbufQueryExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3994,17 +4006,17 @@ for ac_hdr in X11/extensions/Xdbe.h X11/extensions/multibuf.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3998: checking for $ac_hdr" >&5
+echo "configure:4010: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4003 "configure"
+#line 4015 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4046,7 +4058,7 @@ my_includes="$my_includes -I../include -I.."
 
 
 echo $ac_n "checking interactive graphics""... $ac_c" 1>&6
-echo "configure:4050: checking interactive graphics" >&5
+echo "configure:4062: checking interactive graphics" >&5
 if test "$no_x" != "yes" ; then
   cat >> confdefs.h <<\EOF
 #define HAVE_X11 1
index 776c723fe12af6a03f60b5bb7f6b8ecc4df1794c..20cc06498eb751008de0e1040a56d0a579d5f1fb 100644 (file)
@@ -88,7 +88,7 @@ fi
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h unistd.h getopt.h sys/fcntl.h setjmp.h stdarg.h stddef.h sys/types.h sys/stat.h string.h ctype.h math.h stdio.h netinet/in.h inttypes.h sys/param.h stdint.h stdlib.h g2.h)
+AC_CHECK_HEADERS(fcntl.h unistd.h getopt.h sys/fcntl.h setjmp.h stdarg.h stddef.h sys/types.h sys/stat.h string.h ctype.h math.h stdio.h netinet/in.h inttypes.h sys/param.h stdint.h stdlib.h g2.h assert.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -143,19 +143,25 @@ AC_ARG_ENABLE(debug,
 [  --enable-debug          Turn on debugging],
 [case "${enableval}" in
   yes) debug=true 
-       CFLAGS="-g -DDEBUG"
        AC_MSG_RESULT(yes)
        ;;
   no)  debug=false 
        AC_MSG_RESULT(no)
-       CFLAGS="-g -O"
        ;;
   *) AC_MSG_RESULT([bad value ${enableval} for --enable-debug]) 
        ;;
 esac],
-[debug=false])
+[debug=false; AC_MSG_RESULT(no)])
 AM_CONDITIONAL(DEBUG, test "$debug" = "true")
 
+if test "$debug" = "true" ; then
+  CFLAGS="-g -DDEBUG"
+  AC_DEFINE(DEBUG)
+else
+  CFLAGS="-g -O3 -DNDEBUG"
+  AC_DEFINE(NDEBUG)
+fi
+
 dnl Set LAM path
 AC_ARG_WITH(lam,
 [  --with-lam[=PATH]       Set path of LAM MPI ],
index c05887daee491cbd08442e5a23f9575144692490..5039901700e4bc47beb0faece40cf40d2646d1b8 100644 (file)
@@ -65,7 +65,8 @@ Backprojection Method:<br>
 <input type="radio" name="IR_Backproj" value="table">Trig Table<br>
 <input type="radio" name="IR_Backproj" value="diff">Difference<br>
 <input type="radio" name="IR_Backproj" value="diff2">Difference Optimized<br>
-<input type="radio" name="IR_Backproj" value="idiff2" checked>Difference Optimized (integer math)<br>
+<input type="radio" name="IR_Backproj" value="idiff2">Difference Optimized (integer math)<br>
+<input type="radio" name="IR_Backproj" value="idiff3" checked>Difference Highly-optimized (integer math)<br>
 </td></tr></table>
 <p>
 <input type="submit" value="Simulate"><input type="reset" value="clear fields">
index 8104129d5c1129328919adae7583ef02561fb733..9ff8dca58196da35e9f3e7a13a3be0b38f583799 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: array2dfile.h,v 1.3 2000/06/28 15:25:34 kevin Exp $
+**  $Id: array2dfile.h,v 1.4 2000/07/09 08:16:17 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
@@ -164,8 +164,12 @@ public:
 
   bool fileRead (const char* const filename);
 
+  bool fileRead (const string& filename);
+
   bool fileWrite (const char* const filename);
 
+  bool fileWrite (const string& filename);
+
   const string& getFilename (void) const 
       {  return m_filename; }
 
index 0a2a8e12c68b75ed0c91ffc17b42a97cb1e3a659..f0cc19a1d0147ce6da2dab7169f44735418cc2df 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: backprojectors.h,v 1.6 2000/07/07 15:30:59 kevin Exp $
+**  $Id: backprojectors.h,v 1.7 2000/07/09 08:16:17 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
@@ -52,7 +52,8 @@ class Backprojector
     I_2BSPLINE,
     I_3BSPLINE,
 #endif
-    INTERP_LINEAR        // Linear interpolation 
+    INTERP_LINEAR,        // Linear interpolation 
+    INTERP_FREQ_PREINTERPOLATE,
   } InterpolationID;
 
   static const char BPROJ_TRIG_STR[]=     "trig";
@@ -65,7 +66,7 @@ class Backprojector
   static const char INTERP_NEAREST_STR[]=  "nearest";
   static const char INTERP_LINEAR_STR[]=   "linear";
   static const char INTERP_BSPLINE_STR[]=  "bspline";
-
+  static const char INTERP_FREQ_PREINTERPOLATE_STR[]= "freq_preinterpolate";
 
   Backprojector (const Projections& proj, ImageFile& im, const char* const backprojName, const char* const interpName);
 
index 5a0dc9b5a7b8a6ed69d4d58eee6de644d4ecb3d6..07a76ef1cbdf8b808a1d5e3a26f6d22b0c0b156d 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ct.h,v 1.26 2000/07/06 18:37:24 kevin Exp $
+**  $Id: ct.h,v 1.27 2000/07/09 08:16:17 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
@@ -108,6 +108,9 @@ extern "C" {
 #ifdef HAVE_STDINT_H
 #include <stdint.h>             /* Standard ints on Linux */
 #endif
+#ifdef HAVE_ASSERT_H
+#include <assert.h>
+#endif
 
 #ifdef HAVE_FFTW
 #include <rfftw.h>
index 1d340b8bf769755b374c1ee49944b9ff8cc00b7d..ec764a3e778852b604ea29762ef01994b2cf274d 100644 (file)
@@ -3,4 +3,3 @@ libctsim_a_SOURCES = filter.cpp scanner.cpp projections.cpp phantom.cpp imagefil
 
 INCLUDES=@my_includes@
 EXTRA_DIST=Makefile.nt
-
index 03a5f1afdf0424fb3b66584ba1d808e3f5aad6f0..0ed6354454b0a2386cbd9142fd9e64a6834c3968 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: array2dfile.cpp,v 1.4 2000/06/29 12:39:46 kevin Exp $
+**  $Id: array2dfile.cpp,v 1.5 2000/07/09 08:16:17 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
@@ -240,6 +240,12 @@ Array2dFile::freeArray (void)
     }
 }
 
+bool
+Array2dFile::fileWrite (const string& filename)
+{
+  return fileWrite (filename.c_str());
+}
+
 bool
 Array2dFile::fileWrite (const char* const filename)
 {
@@ -262,6 +268,12 @@ Array2dFile::fileWrite (const char* const filename)
     return true;
 }
 
+bool
+Array2dFile::fileRead (const string& filename)
+{
+  return fileRead (filename.c_str());
+}
+
 bool
 Array2dFile::fileRead (const char* const filename)
 {
index 0684c16c5c638e95e01eec79a8d5988968b5ed04..d3cb2035dc125af3415006a2d204cc61b5cc7907 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: backprojectors.cpp,v 1.5 2000/07/07 15:30:59 kevin Exp $
+**  $Id: backprojectors.cpp,v 1.6 2000/07/09 08:16:17 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
@@ -152,6 +152,8 @@ Backprojector::convertInterpolationNameToID (const char* const interpName)
     interpID = INTERP_NEAREST;
   else if (strcasecmp (interpName, INTERP_LINEAR_STR) == 0)
     interpID = INTERP_LINEAR;
+  else if (strcasecmp (interpName, INTERP_FREQ_PREINTERPOLATE_STR) == 0)
+    interpID = INTERP_FREQ_PREINTERPOLATE;
 #if HAVE_BSPLINE_INTERP
   else if (strcasecmp (interpName, INTERP_BSPLINE_STR) == 0)
     interpID = INTERP_BSPLINE;
@@ -180,6 +182,8 @@ Backprojector::convertInterpolationIDToName (const InterpolationID interpID)
     return (INTERP_NEAREST_STR);
   else if (interpID == INTERP_LINEAR)
     return (INTERP_LINEAR_STR);
+  else if (interpID == INTERP_FREQ_PREINTERPOLATE)
+    return (INTERP_FREQ_PREINTERPOLATE_STR);
 #if HAVE_BSPLINE_INTERP
   else if (interpID == INTERP_BSPLINE)
     return (INTERP_BSPLINE_STR);
@@ -471,12 +475,12 @@ BackprojectIntDiff2::BackprojectView (const double* const filteredProj, const do
 {
   double theta = - view_angle;  // add half PI to view angle to get perpendicular theta angle
 
-  kint32 scale = 1 << 16;
-  double dScale = scale;
-  kint32 halfScale = scale / 2;
+  static const kint32 scale = 1 << 16;
+  static const double dScale = scale;
+  static const kint32 halfScale = scale / 2;
 
-  kint32 det_dx = nearest<kint32> (xInc * sin (theta) / detInc * scale);
-  kint32 det_dy = nearest<kint32> (yInc * cos (theta) / detInc * scale);
+  const kint32 det_dx = nearest<kint32> (xInc * sin (theta) / detInc * scale);
+  const kint32 det_dy = nearest<kint32> (yInc * cos (theta) / detInc * scale);
 
   // calculate L for first point in image (0, 0) 
   kint32 detPosColStart = nearest<kint32> (start_r * cos (theta - start_phi) / detInc * scale);
@@ -524,8 +528,10 @@ BackprojectIntDiff3::BackprojectView (const double* const filteredProj, const do
   double theta = - view_angle;  // add half PI to view angle to get perpendicular theta angle
   static const int scaleShift = 16;
   static const kint32 scale = (1 << scaleShift);
+  static const kint32 scaleBitmask = scale - 1;
   static const double dScale = scale;
   static const kint32 halfScale = scale / 2;
+  static const double dInvScale = 1. / scale;
 
   const kint32 det_dx = nearest<kint32> (xInc * sin (theta) / detInc * scale);
   const kint32 det_dy = nearest<kint32> (yInc * cos (theta) / detInc * scale);
@@ -537,28 +543,26 @@ BackprojectIntDiff3::BackprojectView (const double* const filteredProj, const do
     kint32 curDetPos = detPosColStart;
     ImageFileColumn pImCol = v[ix];
 
-    for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
-      if (interpType == Backprojector::INTERP_NEAREST) {
-       int iDetPos = (curDetPos + halfScale) >> scaleShift;
-
-       if (iDetPos < 0 || iDetPos >= nDet)  // check for impossible: index outside of raysum pos 
-           errorIndexOutsideDetector (ix, iy, theta, curDetPos, iDetPos);
-       else
-         *pImCol++ += filteredProj[iDetPos];
-      } else if (interpType == Backprojector::INTERP_LINEAR) {
-       kint32 detPosFloor = curDetPos / scale;
-       kint32 detPosRemainder = curDetPos % scale;
-       if (detPosRemainder < 0) {
-         detPosFloor--;
-         detPosRemainder += scale;
-       }
-       int iDetPos = iDetCenter + detPosFloor;
-       double frac = detPosRemainder / dScale;
-       if (iDetPos < 0 || iDetPos >= nDet - 1)
-           errorIndexOutsideDetector (ix, iy, theta, curDetPos, iDetPos);
-       else
-         *pImCol++ += ((1.-frac) * filteredProj[iDetPos] + frac * filteredProj[iDetPos+1]);
-      }
-    }  // end for y
-  }    // end for x
+    if (interpType == Backprojector::INTERP_NEAREST) {
+      for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
+       int iDetPos = (curDetPos + halfScale) >> 16;
+       assert(iDetPos >= 0 && iDetPos < nDet);
+       *pImCol++ += filteredProj[iDetPos];
+      }        // end for iy
+    } else if (interpType == Backprojector::INTERP_LINEAR) {
+      for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {
+       kint32 iDetPos = curDetPos >> scaleShift;
+       kint32 detRemainder = curDetPos & scaleBitmask;
+#if 0
+       double frac = detRemainder * (1. / 65536.);
+       assert(iDetPos >= 0 && iDetPos < nDet - 1);
+       *pImCol++ += ((1.-frac) * filteredProj[iDetPos]) + (frac * filteredProj[iDetPos+1]);
+#else
+       assert(iDetPos >= 0 && iDetPos < nDet - 1);
+       const double* const detPointer = &filteredProj[iDetPos];
+       *pImCol++ += (((scale-detRemainder) * *detPointer) + (detRemainder * *(detPointer+1))) * dInvScale;
+#endif
+      }        // end for iy
+    } //end linear
+  } // end for ix
 }
index 616f189333405a165cdc87093324842912745555..9b48e9c22d45f1da8313fad2af0cd42cf96934e7 100644 (file)
@@ -3,25 +3,35 @@ bin_SCRIPTS = sample-ctsim.sh
 EXTRA_PROGRAMS = pjrec-lam phm2pj-lam phm2if-lam
 INCLUDES=@my_includes@
 EXTRA_DIST=Makefile.nt mpiworld.cpp
+SOURCE_DEPEND=../include/ct.h ../libctsim/libctsim.a ../libctsupport/libctsupport.a ../libctgraphics/libctgraphics.a
 
-ctsim_SOURCES = ctsim.cpp
+ctsim_SOURCES = ctsim.cpp $
 ctsim_LDADD = @ctlibs@
-pjrec_SOURCES = pjrec.cpp 
+ctsim_DEPENDENCIES=$(SOURCE_DEPEND)
+pjrec_SOURCES = pjrec.cpp  
 pjrec_LDADD=@ctlibs@
-phm2pj_SOURCES=phm2pj.cpp
+pjrec_DEPENDENCIES=$(SOURCE_DEPEND)
+phm2pj_SOURCES=phm2pj.cpp 
 phm2pj_LDADD=@ctlibs@
+phm2pj_DEPENDENCIES=$(SOURCE_DEPEND)
 phm2if_SOURCES = phm2if.cpp
 phm2if_LDADD=@ctlibs@
+phm2if_DEPENDENCIES=$(SOURCE_DEPEND)
 if2img_SOURCES = if2img.cpp
 if2img_LDADD=@ctlibs@
+if2img_DEPENDENCIES=$(SOURCE_DEPEND)
 pj2if_SOURCES = pj2if.cpp
 pj2if_LDADD=@ctlibs@
-if_1_SOURCES=if-1.cpp
+pj2if_DEPENDENCIES=$(SOURCE_DEPEND)
+if_1_SOURCES=if-1.cpp 
 if_1_LDADD=@ctlibs@
-if_2_SOURCES=if-2.cpp
+if_1_DEPENDENCIES=$(SOURCE_DEPEND)
+if_2_SOURCES=if-2.cpp 
 if_2_LDADD=@ctlibs@
+if_2_DEPENDENCIES=$(SOURCE_DEPEND)
 ifinfo_SOURCES = ifinfo.cpp
 ifinfo_LDADD=@ctlibs@
+ifinfo_DEPENDENCIES=$(SOURCE_DEPEND)
 
 pjrec_lam_SOURCES=pjrec.cpp
 pjrec_lam_LDADD=@ctlamlibs@
index 545920ad0d74475310afc64ef449a6dd2e05d3bf..7757f72da9071fddb45c1b2afd4e0d6f46e6277b 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if-2.cpp,v 1.9 2000/06/28 15:25:34 kevin Exp $
+**  $Id: if-2.cpp,v 1.10 2000/07/09 08:16:18 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
@@ -32,7 +32,7 @@
 #include "ct.h"
 #include "timer.h"
 
-enum {O_ADD, O_SUB, O_MUL, O_COMP, O_VERBOSE, O_HELP, O_VERSION};
+enum {O_ADD, O_SUB, O_MUL, O_COMP, O_ROW_PLOT, O_COLUMN_PLOT, O_VERBOSE, O_HELP, O_VERSION};
 
 static struct option my_options[] =
 {
@@ -40,6 +40,8 @@ static struct option my_options[] =
   {"sub", 0, 0, O_SUB},
   {"mul", 0, 0, O_MUL},
   {"comp", 0, 0, O_COMP},
+  {"column-plot", 1, 0, O_COLUMN_PLOT},
+  {"row-plot", 1, 0, O_ROW_PLOT},
   {"verbose", 0, 0, O_VERBOSE},
   {"help", 0, 0, O_HELP},
   {"version", 0, 0, O_VERSION},
@@ -50,18 +52,20 @@ void
 if2_usage (const char *program)
 {
   cout << "usage: " << fileBasename(program) << " infile1 infile2 outfile [OPTIONS]" << endl;
-  cout << "Generate an image file from two input image files files" << endl;
+  cout << "Perform functions on two input image files" << endl;
   cout << endl;
-  cout << "     infile1    Name of first input IF file" << endl;
-  cout << "     infile2    Name of second input IF file" << endl;
-  cout << "     outfile    Name of output IF file" << endl;
-  cout << "     --add      Add images" << endl;
-  cout << "     --sub      Subtract image 2 from image 1" << endl;
-  cout << "     --mul      Multiply images" << endl;
-  cout << "     --comp     Compare images" << endl;
-  cout << "     --verbose  Verbose modem" << endl;
-  cout << "     --version  Print version" << endl;
-  cout << "     --help     Print this help message" << endl;
+  cout << "     infile1            Name of first input IF file" << endl;
+  cout << "     infile2            Name of second input IF file" << endl;
+  cout << "     outfile            Name of output IF file" << endl;
+  cout << "     --add              Add images" << endl;
+  cout << "     --sub              Subtract image 2 from image 1" << endl;
+  cout << "     --mul              Multiply images" << endl;
+  cout << "     --comp             Compare images" << endl;
+  cout << "     --column-plot n    Plot column\n";
+  cout << "     --row-plot n       Plot row\n";
+  cout << "     --verbose          Verbose modem" << endl;
+  cout << "     --version          Print version" << endl;
+  cout << "     --help             Print this help message" << endl;
 }
 
 int 
@@ -70,18 +74,21 @@ if2_main (int argc, char *const argv[])
   ImageFile* pim_in1;
   ImageFile* pim_in2;
   ImageFile* pim_out;
-  char *in_file1;
-  char *in_file2;
-  char *out_file;
+  string in_file1;
+  string in_file2;
+  string out_file;
   int opt_verbose = 0;
   int opt_add = 0;
   int opt_sub = 0;
   int opt_mul = 0;
   int opt_comp = 0;
-
+  int opt_outputFile = 0;
+  int opt_rowPlot = -1;
+  int opt_columnPlot = -1;
   Timer timerProgram;
 
   while (1) {
+    char* endptr;
     int c = getopt_long (argc, argv, "", my_options, NULL);
       
     if (c == -1)
@@ -90,13 +97,26 @@ if2_main (int argc, char *const argv[])
     switch (c) {
     case O_ADD:
       opt_add = 1;
+      opt_outputFile = 1;
       break;
     case O_SUB :
       opt_sub = 1;
+      opt_outputFile = 1;
       break;
     case O_MUL:
       opt_mul = 1;
+      opt_outputFile = 1;
       break;
+    case O_ROW_PLOT:
+      opt_rowPlot = strtol(optarg, &endptr, 10);
+      if (endptr != optarg + strlen(optarg)) {
+       if2_usage(argv[0]);
+      }
+    case O_COLUMN_PLOT:
+      opt_columnPlot = strtol(optarg, &endptr, 10);
+      if (endptr != optarg + strlen(optarg)) {
+       if2_usage(argv[0]);
+      }
     case O_COMP:
       opt_comp = 1;
       break;
@@ -119,15 +139,20 @@ if2_main (int argc, char *const argv[])
       return (1);
     }
   }
-  
-  if (optind + 3 != argc) {
+
+  if (opt_outputFile && (optind + 3 != argc)) {
+    if2_usage(argv[0]);
+    return (1);
+  }
+  else if (! opt_outputFile && optind + 2 != argc) {
     if2_usage(argv[0]);
     return (1);
   }
   
   in_file1 = argv[optind];
   in_file2 = argv[optind + 1];
-  out_file = argv[optind + 2];
+  if (opt_outputFile)
+    out_file = argv[optind + 2];
 
   pim_in1 = new ImageFile ();
   pim_in2 = new ImageFile ();
@@ -149,14 +174,16 @@ if2_main (int argc, char *const argv[])
       return(1);
   }
 
-  pim_out = new ImageFile (im_in1.nx(), im_in1.ny());
-  ImageFile& im_out = *pim_out;
-
-  string strOperation;
   ImageFileArray v1 = im_in1.getArray();
   ImageFileArray v2 = im_in2.getArray();
-  ImageFileArray vout = im_out.getArray();
+  ImageFileArray vout = NULL;
+
+  if (opt_outputFile) {
+    pim_out = new ImageFile (im_in1.nx(), im_in1.ny());
+    vout = pim_out->getArray();
+  }
 
+  string strOperation;
   if (opt_add) {
     strOperation = "Add Images";
     for (int ix = 0; ix < im_in1.nx(); ix++) {
@@ -184,28 +211,81 @@ if2_main (int argc, char *const argv[])
       for (int iy = 0; iy < im_in1.ny(); iy++)
        *out++ = *in1++ * *in2++;
     }
-  } else if (opt_comp) {
-    double abs_error = 0.;
-    strOperation = "Subtract Images";
-    for (int ix = 0; ix < im_in1.nx(); ix++) {
-      ImageFileColumn in1 = v1[ix];
-      ImageFileColumn in2 = v2[ix];
-      ImageFileColumn out = vout[ix];
-      for (int iy = 0; iy < im_in1.ny(); iy++) {
-       double diff = *in1++ - *in2++;
-       *out++ = diff;
-      }
-    }
+  }
+  if (opt_comp) {
     double d, r, e;
     im_in1.comparativeStatistics (im_in2, d, r, e);
     cout << "d=" << d << ", r=" << r << ", e=" << e << endl;
   }
+  if (opt_columnPlot > 0) {
+    if (opt_columnPlot >= im_in1.nx() || opt_columnPlot >= im_in2.nx()) {
+      sys_error (ERR_SEVERE, "column-plot > nx");
+      return (1);
+    }
+    double plot_xaxis [im_in1.nx()];
+    for (int i = 0; i < im_in1.nx(); i++)
+      plot_xaxis[i] = i;
+#if HAVE_SGP
+#if 0
+#else
+    ezset  ("clear.");
+    ezset  ("xticks major 5.");
+    ezset  ("xlabel Column");
+    ezset  ("ylabel Pixel");
+    ezset ("curves 2");
+    ezset  ("box.");
+    ezset  ("grid.");
+    ezplot (v1[opt_columnPlot], plot_xaxis, im_in1.ny());
+    ezplot (v2[opt_columnPlot], plot_xaxis, im_in2.ny());
+#endif
+    char str[256];
+    cout << "Press enter to continue" << flush;
+    fgets(str, sizeof(str), stdin);
+    sgp2_close (sgp2_get_active_win());
+#endif
+  }
 
-  im_out.labelsCopy (im_in1, "if-2 file 1: ");
-  im_out.labelsCopy (im_in2, "if-2 file 2: ");
-  im_out.labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str(), timerProgram.timerEnd());
+  if (opt_rowPlot > 0) {
+    if (opt_rowPlot >= im_in1.ny() || opt_rowPlot >= im_in2.ny()) {
+      sys_error (ERR_SEVERE, "row_plot > ny");
+      return (1);
+    }
+    double plot_xaxis [im_in1.ny()];
+    double v1Row[im_in1.nx()], v2Row[im_in2.nx()];
+
+    for (int i = 0; i < im_in1.ny(); i++)
+      plot_xaxis[i] = i;
+    for (int i = 0; i < im_in1.nx(); i++)
+      v1Row[i] = v1[opt_rowPlot][i];
+    for (int i = 0; i < im_in2.nx(); i++)
+      v2Row[i] = v2[opt_rowPlot][i];
 
-  im_out.fileWrite(out_file);
+#if HAVE_SGP
+#if 0
+#else
+    ezset  ("clear.");
+    ezset  ("xticks major 5.");
+    ezset  ("xlabel Column");
+    ezset  ("ylabel Pixel");
+    ezset ("curves 2");
+    ezset  ("box.");
+    ezset  ("grid.");
+    ezplot (v1Row, plot_xaxis, im_in1.nx());
+    ezplot (v2Row, plot_xaxis, im_in2.nx());
+#endif
+    char str[256];
+    cout << "Press enter to continue" << flush;
+    fgets(str, sizeof(str), stdin);
+    sgp2_close (sgp2_get_active_win());
+#endif
+  }
+
+  if (opt_outputFile) {
+    pim_out->labelsCopy (im_in1, "if-2 file 1: ");
+    pim_out->labelsCopy (im_in2, "if-2 file 2: ");
+    pim_out->labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str(), timerProgram.timerEnd());
+    pim_out->fileWrite(out_file);
+  }
 
   return (0);
 }
index 2547b512de7b9e939ba0c51becd97653ae77ba9f..6945de8bd8b740ecde72441c0ef6ed20a286a5cd 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if2img.cpp,v 1.10 2000/07/04 22:21:01 kevin Exp $
+**  $Id: if2img.cpp,v 1.11 2000/07/09 08:16:18 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
@@ -411,9 +411,9 @@ if2img_main (int argc, char *const argv[])
 #endif
   else if (opt_format == O_FORMAT_DISP) {
 #if HAVE_SGP
-    // image_display_scale (im, opt_scale, densmin, densmax);
-    //  cio_kb_getc();
-      sgp2_close(sgp2_get_active_win());
+    im.displayScaling (opt_scale, densmin, densmax);
+    cio_kb_getc();
+    sgp2_close(sgp2_get_active_win());
 #endif
   }
   else
index 321fc5c5890a2fefe6e4b5a3bda926cbefb1804c..6149c9e634faea48a2875c88677fca5070554dc2 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ifinfo.cpp,v 1.12 2000/06/27 10:48:11 kevin Exp $
+**  $Id: ifinfo.cpp,v 1.13 2000/07/09 08:16:18 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
@@ -49,7 +49,7 @@ static struct option my_options[] =
 void 
 ifinfo_usage (const char *program)
 {
-  cout << "usage: " << fileBasename(program) << " image1 [image2] [OPTIONS]" << endl;
+  cout << "usage: " << fileBasename(program) << " image-filename [OPTIONS]" << endl;
   cout << "Imagefile information" << endl;
   cout << endl;
   cout << "     infile       Name of input IF file" << endl;
@@ -68,9 +68,7 @@ int
 ifinfo_main (int argc, char *const argv[])
 {
   ImageFile *im = NULL;
-  ImageFile* im2 = NULL;
   string in_file;
-  string in2_file;
   int opt_verbose = 0;
   int opt_stats = 1;
   int opt_labels = 1;
@@ -120,9 +118,7 @@ ifinfo_main (int argc, char *const argv[])
        }
     }
 
-  if (optind + 2 == argc) {
-    in2_file = argv [optind+1];
-  } else if (optind + 1 != argc) {
+  if (optind + 1 != argc) {
     ifinfo_usage (argv[0]);
     return (1);
   }
@@ -130,45 +126,19 @@ ifinfo_main (int argc, char *const argv[])
   in_file = argv[optind];
 
   im = new ImageFile ();
-  if (! im->fileRead (in_file.c_str())) {
+  if (! im->fileRead (in_file)) {
     sys_error (ERR_WARNING, "Unable to read file %s", in_file.c_str());
     return (1);
   }
-  if (in2_file != "") {
-    im2 = new ImageFile();
-    if (! im2->fileRead (in2_file.c_str())) {
-      sys_error (ERR_WARNING, "Unable to read file %s", in2_file.c_str());
-      return (1);
-    }
-  }
-
-  if (opt_stats)
-    cout << "Image size: (" << im->nx() << "," << im->ny() << ")" << endl << endl;
 
-  if (im2)
-    cout << "Image 1: " << im->getFilename() << endl;
-    
   if (opt_labels) 
     im->printLabels (cout);
 
   if (opt_stats) {
+    cout << "Size: (" << im->nx() << "," << im->ny() << ")" << endl;
     im->printStatistics (cout);
-
-    if (im2) {
-      cout << endl;
-
-      cout << "Image 2: " << im2->getFilename() << endl;
-
-      if (opt_labels)
-       im2->printLabels(cout);
-
-      im2->printStatistics (cout);
-      cout << endl;
-      
-      im->printComparativeStatistics (*im2, cout);
-    }
   }
-  
+
   return (0);
 }
 
index c64f6ae849c958e6e228e0907550d80099f4607a..40a8cba5633e0636aab73888f9498fcf6eafcc6c 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: pjrec.cpp,v 1.8 2000/07/06 18:37:24 kevin Exp $
+**  $Id: pjrec.cpp,v 1.9 2000/07/09 08:16:18 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
@@ -92,6 +92,7 @@ pjrec_usage (const char *program)
   cout << "    diff        Difference method" << endl;
   cout << "    diff2       Optimized difference method (default)" << endl;
   cout << "    idiff2      Optimized difference method with integer math" << 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;
index efc14e2fa724d4b0c9b67b0ebba74ab6d24c3a2b..1277641c8fbb350878bf02a6e40c915ca982dd11 100755 (executable)
@@ -35,7 +35,7 @@ if [ -f sample-rec.if ]; then
   ${bin}if2img sample-rec.if sample-rec.png --format png
   ${bin}if2img sample-rec.if sample-rec16.png --format png16
 
-  ${bin}ifinfo sample-phm.if sample-rec.if
+  ${bin}if-2 sample-phm.if sample-rec.if --comp
 fi
 
 # Files sample-phm.png, sample-pj.png, and sample-rec.png are ready for display