From 03df7888191e78f927537a2993d20e402d4d4997 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 17 Dec 2000 22:39:23 +0000 Subject: [PATCH] r274: Renamed if2img to ifexport --- ChangeLog | 7 ++++--- README | 8 ++++---- cgi-bin/ctsim.cgi.in | 8 ++++---- rpm/ctsim.spec | 4 ++-- tools/Makefile.am | 8 ++++---- tools/{if2img.cpp => ifexport.cpp} | 30 +++++++++++++++--------------- tools/sample-ctsim.sh.in | 12 ++++++------ 7 files changed, 39 insertions(+), 38 deletions(-) rename tools/{if2img.cpp => ifexport.cpp} (95%) diff --git a/ChangeLog b/ChangeLog index 4922d93..0f2442d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,15 @@ 2.1.0 - 12/18/00 + Improved pjinfo to output binary headers and view data, useful + when manually compiling phantoms that vary during projection + process. Thanks to Ian Kay for idea and code submission. Modifications for Microsoft Visual C++ compilation. First Microsoft Windows GUI version Improved sorting to find median in ImageFile::statistics Fixed core-dump bug in Array2dFile::labelsCopy() function (Ian Kay) - Improved pjinfo to output binary headers and view data, useful - when manually compiling phantoms that vary during projection - process. Thanks to Ian Kay for idea and code submission. Changed code to explicitly use std:: namespace rather than "namespace using std" statements Changed reconstruction dialog to fix onto smaller screens + Renamed if2img to ifexport 2.0.6 - 12/03/00 Fixed minor compilation problem with procsignal.h diff --git a/README b/README index d59b1cc..b011f1f 100644 --- a/README +++ b/README @@ -62,7 +62,7 @@ SDF file. pj2if - Converts projection data to a raw sinugram image -if2img - Converts an image file to a variety of 8-bit and 16-bit image +ifexport - Converts an image file to a variety of 8-bit and 16-bit image formats pjinfo - Show information on a projection file @@ -86,16 +86,16 @@ When evaluating CT simulation, in general, these steps are followed: Create a phantom image and viewable image file phm2if ... - if2img ... + ifexport ... Simulate CT data collection and create a viewable image of raw projections phm2pj ... pj2if ... - if2img ... + ifexport ... Perform CT reconstruction and create viewable image file pjrec ... - if2img ... + ifexport ... Display image information and comparative statistics ifinfo ... diff --git a/cgi-bin/ctsim.cgi.in b/cgi-bin/ctsim.cgi.in index 959d69b..0f67bed 100755 --- a/cgi-bin/ctsim.cgi.in +++ b/cgi-bin/ctsim.cgi.in @@ -120,10 +120,10 @@ if ($Disp_Max ne 'auto') { $window_options .= " --max $Disp_Max"; } -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 $sub_fname $sub_png --auto $auto_window_diff --stats --format png"; +my $png1_cmd = "$::bindir/ifexport $phantom_fname $phantom_png $window_options --stats --format png"; +my $png2_cmd = "$::bindir/ifexport $ir_fname $ir_png $window_options --stats --format png"; +my $png3_cmd = "$::bindir/ifexport $pj_if_fname $pj_png --auto $auto_window_pj --stats --format png"; +my $png4_cmd = "$::bindir/ifexport $sub_fname $sub_png --auto $auto_window_diff --stats --format png"; my $title = "CT Simulation Results"; diff --git a/rpm/ctsim.spec b/rpm/ctsim.spec index d821371..61c4f6a 100644 --- a/rpm/ctsim.spec +++ b/rpm/ctsim.spec @@ -29,7 +29,7 @@ install -s -m 755 -o 0 -g 0 tools/phm2pj /usr/local/bin/phm2pj install -s -m 755 -o 0 -g 0 tools/phm2if /usr/local/bin/phm2if install -s -m 755 -o 0 -g 0 tools/if-1 /usr/local/bin/if-1 install -s -m 755 -o 0 -g 0 tools/if-2 /usr/local/bin/if-2 -install -s -m 755 -o 0 -g 0 tools/if2img /usr/local/bin/if2img +install -s -m 755 -o 0 -g 0 tools/ifexport /usr/local/bin/ifexport install -s -m 755 -o 0 -g 0 tools/if-1 /usr/local/bin/ifinfo install -m 755 -o 0 -g 0 tools/sample-ctsim.sh /usr/local/bin/sample-ctsim.sh @@ -43,7 +43,7 @@ install -m 755 -o 0 -g 0 tools/sample-ctsim.sh /usr/local/bin/sample-ctsim.sh /usr/local/bin/phm2if /usr/local/bin/if-1 /usr/local/bin/if-2 -/usr/local/bin/if2img +/usr/local/bin/ifexport /usr/local/bin/ifinfo /usr/local/bin/sample-ctsim.sh diff --git a/tools/Makefile.am b/tools/Makefile.am index 7f2398b..8dfcddf 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,4 +1,4 @@ -bin_PROGRAMS = pjrec phm2pj pj2if @lamprograms@ ifinfo phm2if if-1 if-2 if2img pjinfo +bin_PROGRAMS = pjrec phm2pj pj2if @lamprograms@ ifinfo phm2if if-1 if-2 ifexport pjinfo bin_SCRIPTS = sample-ctsim.sh EXTRA_PROGRAMS = pjrec-lam phm2pj-lam phm2if-lam INCLUDES=@my_includes@ @@ -19,9 +19,9 @@ 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) +ifexport_SOURCES = ifexport.cpp +ifexport_LDADD=@ctlibs@ +ifexport_DEPENDENCIES=$(SOURCE_DEPEND) pj2if_SOURCES = pj2if.cpp pj2if_LDADD=@ctlibs@ pj2if_DEPENDENCIES=$(SOURCE_DEPEND) diff --git a/tools/if2img.cpp b/tools/ifexport.cpp similarity index 95% rename from tools/if2img.cpp rename to tools/ifexport.cpp index 6193704..4b4c504 100644 --- a/tools/if2img.cpp +++ b/tools/ifexport.cpp @@ -1,7 +1,7 @@ /***************************************************************************** ** FILE IDENTIFICATION ** -** Name: if2img.cpp +** Name: ifexport.cpp ** Purpose: Convert an image file to a viewable image ** Programmer: Kevin Rosenberg ** Date Started: April 2000 @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if2img.cpp,v 1.7 2000/12/16 07:28:25 kevin Exp $ +** $Id: ifexport.cpp,v 1.1 2000/12/17 22:39:23 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 @@ -48,7 +48,7 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: if2img.cpp,v 1.7 2000/12/16 07:28:25 kevin Exp $"; +static const char* g_szIdStr = "$Id: ifexport.cpp,v 1.1 2000/12/17 22:39:23 kevin Exp $"; enum { O_AUTO_FULL, O_AUTO_STD0_1, O_AUTO_STD0_5, O_AUTO_STD1, O_AUTO_STD2, O_AUTO_STD3 }; static const char O_AUTO_FULL_STR[]="full"; @@ -72,7 +72,7 @@ static const char O_FORMAT_PGMASC_STR[]="pgmasc"; static const char O_FORMAT_DISP_STR[]="disp"; void -if2img_usage (const char *program) +ifexport_usage (const char *program) { std::cout << "usage: " << fileBasename(program) << " ifname outfile [OPTIONS]\n"; std::cout << "Convert IF file to an image file\n"; @@ -114,7 +114,7 @@ if2img_usage (const char *program) int -if2img_main (int argc, char *const argv[]) +ifexport_main (int argc, char *const argv[]) { ImageFile* pim = NULL; double densmin = HUGE_VAL, densmax = -HUGE_VAL; @@ -148,7 +148,7 @@ if2img_main (int argc, char *const argv[]) if (endptr != endstr) { sys_error (ERR_SEVERE, "Error setting --min to %s", optarg); - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } break; @@ -159,7 +159,7 @@ if2img_main (int argc, char *const argv[]) if (endptr != endstr) { sys_error (ERR_SEVERE, "Error setting --max to %s", optarg); - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } break; @@ -169,7 +169,7 @@ if2img_main (int argc, char *const argv[]) if (endptr != endstr) { sys_error (ERR_SEVERE, "Error setting --scale to %s", optarg); - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } break; @@ -189,7 +189,7 @@ if2img_main (int argc, char *const argv[]) else { sys_error (ERR_SEVERE, "Invalid auto mode %s", optarg); - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } break; @@ -203,7 +203,7 @@ if2img_main (int argc, char *const argv[]) else { sys_error (ERR_SEVERE, "Invalid center mode %s", optarg); - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } break; @@ -226,7 +226,7 @@ if2img_main (int argc, char *const argv[]) opt_format = O_FORMAT_DISP; else { sys_error (ERR_SEVERE, "Invalid format mode %s", optarg); - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } break; @@ -251,10 +251,10 @@ if2img_main (int argc, char *const argv[]) return (0); case O_HELP: case '?': - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (0); default: - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } } @@ -266,7 +266,7 @@ if2img_main (int argc, char *const argv[]) if ((opt_format == O_FORMAT_DISP && optind + 1 != argc) || (opt_format != O_FORMAT_DISP && optind + 2 != argc)) { - if2img_usage(argv[0]); + ifexport_usage(argv[0]); return (1); } @@ -387,7 +387,7 @@ main (int argc, char *const argv[]) int retval = 1; try { - retval = if2img_main(argc, argv); + retval = ifexport_main(argc, argv); } catch (exception e) { cerr << "Exception: " << e.what() << std::endl; } catch (...) { diff --git a/tools/sample-ctsim.sh.in b/tools/sample-ctsim.sh.in index 1277641..ab0f6dd 100755 --- a/tools/sample-ctsim.sh.in +++ b/tools/sample-ctsim.sh.in @@ -15,8 +15,8 @@ fi ${bin}phm2if sample-phm.if 256 256 --nsample 2 --phantom herman if [ -f sample-phm.if ] ; then - ${bin}if2img sample-phm.if sample-phm.png --format png - ${bin}if2img sample-phm.if sample-phm16.png --format png16 + ${bin}ifexport sample-phm.if sample-phm.png --format png + ${bin}ifexport sample-phm.if sample-phm16.png --format png16 fi # Simulate CT data collection and generate raysum sinugram for display @@ -25,15 +25,15 @@ if [ -f sample-pj.pj ]; then ${bin}pj2if sample-pj.pj sample-pj.if fi if [ -f sample-pj.if ]; then - ${bin}if2img sample-pj.if sample-pj.png --format png - ${bin}if2img sample-pj.if sample-pj16.png --format png16 + ${bin}ifexport sample-pj.if sample-pj.png --format png + ${bin}ifexport sample-pj.if sample-pj16.png --format png16 fi # Reconstruct raysums and generate image for display ${bin}pjrec sample-pj.pj sample-rec.if 256 256 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}ifexport sample-rec.if sample-rec.png --format png + ${bin}ifexport sample-rec.if sample-rec16.png --format png16 ${bin}if-2 sample-phm.if sample-rec.if --comp fi -- 2.34.1