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
#undef HAVE_WXWINDOWS
#undef HAVE_FFTW
+
+#undef DEBUG
+
+#undef NDEBUG
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;
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') {
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";
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`;
$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);
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";
#undef HAVE_FFTW
+#undef DEBUG
+
+#undef NDEBUG
+
/* The number of bytes in a double. */
#undef SIZEOF_DOUBLE
/* 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
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; }
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
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
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"
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"
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"
# 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
# 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*
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.
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
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
# 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
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
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
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
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
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
# 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. */
; 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
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
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
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
# -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. */
; 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
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
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
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
# 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. */
; 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
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
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
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
# 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. */
; 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
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
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
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
# 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
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
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
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
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
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
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
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
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
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
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
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
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*
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
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
[ --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 ],
<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">
** 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
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; }
** 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
I_2BSPLINE,
I_3BSPLINE,
#endif
- INTERP_LINEAR // Linear interpolation
+ INTERP_LINEAR, // Linear interpolation
+ INTERP_FREQ_PREINTERPOLATE,
} InterpolationID;
static const char BPROJ_TRIG_STR[]= "trig";
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);
** 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
#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>
INCLUDES=@my_includes@
EXTRA_DIST=Makefile.nt
-
** 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
}
}
+bool
+Array2dFile::fileWrite (const string& filename)
+{
+ return fileWrite (filename.c_str());
+}
+
bool
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)
{
** 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
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;
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);
{
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);
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);
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
}
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@
** 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
#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[] =
{
{"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},
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
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)
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;
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 ();
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++) {
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);
}
** 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
#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
** 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
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;
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;
}
}
- if (optind + 2 == argc) {
- in2_file = argv [optind+1];
- } else if (optind + 1 != argc) {
+ if (optind + 1 != argc) {
ifinfo_usage (argv[0]);
return (1);
}
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);
}
** 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
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;
${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