From b9dfe2d5cee6f08652541f3c5318f78d50314161 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 16 Dec 2000 07:28:25 +0000 Subject: [PATCH] r262: Make std:: namespace explicit --- ChangeLog | 5 +- tools/if-1.cpp | 36 +++++++------- tools/if-2.cpp | 56 +++++++++++----------- tools/if2img.cpp | 98 +++++++++++++++++++------------------- tools/ifinfo.cpp | 46 +++++++++--------- tools/phm2if.cpp | 120 +++++++++++++++++++++++------------------------ tools/phm2pj.cpp | 108 +++++++++++++++++++++--------------------- tools/pj2if.cpp | 30 ++++++------ tools/pjinfo.cpp | 46 +++++++++--------- 9 files changed, 273 insertions(+), 272 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ff29ff..95aab3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,8 +3,9 @@ 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 initial code submission. - + process. Thanks to Ian Kay for idea and code submission. + Changed code to explicitly use std:: namespace + 2.0.6 - 12/03/00 Fixed minor compilation problem with procsignal.h Updated README file diff --git a/tools/if-1.cpp b/tools/if-1.cpp index cd61c38..48c4b8d 100644 --- a/tools/if-1.cpp +++ b/tools/if-1.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if-1.cpp,v 1.3 2000/08/03 09:57:29 kevin Exp $ +** $Id: if-1.cpp,v 1.4 2000/12/16 07:28:25 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -46,22 +46,22 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: if-1.cpp,v 1.3 2000/08/03 09:57:29 kevin Exp $"; +static const char* g_szIdStr = "$Id: if-1.cpp,v 1.4 2000/12/16 07:28:25 kevin Exp $"; void if1_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " infile outfile [OPTIONS]" << endl; - cout << "Generate a IF file from a IF file" << endl; - cout << endl; - cout << " --invert Invert image" << endl; - cout << " --log Natural logrithm of image" << endl; - cout << " --exp Natural exponential of image" << endl; - cout << " --sqr Square of image" << endl; - cout << " --sqrt Square root of image" << endl; - cout << " --verbose Verbose modem" << endl; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << "usage: " << fileBasename(program) << " infile outfile [OPTIONS]" << std::endl; + std::cout << "Generate a IF file from a IF file" << std::endl; + std::cout << std::endl; + std::cout << " --invert Invert image" << std::endl; + std::cout << " --log Natural logrithm of image" << std::endl; + std::cout << " --exp Natural exponential of image" << std::endl; + std::cout << " --sqr Square of image" << std::endl; + std::cout << " --sqrt Square root of image" << std::endl; + std::cout << " --verbose Verbose modem" << std::endl; + std::cout << " --version Print version" << std::endl; + std::cout << " --help Print this help message" << std::endl; } int @@ -107,9 +107,9 @@ if1_main (int argc, char *const argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cout << "Unknown version number" << endl; + std::cout << "Unknown version number" << std::endl; #endif return (0); case O_HELP: @@ -132,7 +132,7 @@ if1_main (int argc, char *const argv[]) out_file = argv[optind + 1]; - string histString; + std::string histString; if (opt_invert || opt_log || opt_exp || opt_sqr || opt_sqrt) { int ix, iy; @@ -194,9 +194,9 @@ main (int argc, char *const argv[]) try { retval = if1_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + cerr << "Unknown exception" << std::endl; } return (retval); diff --git a/tools/if-2.cpp b/tools/if-2.cpp index dfea498..70b206d 100644 --- a/tools/if-2.cpp +++ b/tools/if-2.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if-2.cpp,v 1.5 2000/08/03 09:57:29 kevin Exp $ +** $Id: if-2.cpp,v 1.6 2000/12/16 07:28:25 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 @@ -45,26 +45,26 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: if-2.cpp,v 1.5 2000/08/03 09:57:29 kevin Exp $"; +static const char* g_szIdStr = "$Id: if-2.cpp,v 1.6 2000/12/16 07:28:25 kevin Exp $"; void if2_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " infile1 infile2 outfile [OPTIONS]" << 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 << " --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; + std::cout << "usage: " << fileBasename(program) << " infile1 infile2 outfile [OPTIONS]\n"; + std::cout << "Perform functions on two input image files\n"; + std::cout << std::endl; + std::cout << " infile1 Name of first input IF file\n"; + std::cout << " infile2 Name of second input IF file\n"; + std::cout << " outfile Name of output IF file\n"; + std::cout << " --add Add images\n"; + std::cout << " --sub Subtract image 2 from image 1\n"; + std::cout << " --mul Multiply images\n"; + std::cout << " --comp Compare images\n"; + std::cout << " --column-plot n Plot column\n"; + std::cout << " --row-plot n Plot row\n"; + std::cout << " --verbose Verbose modem\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } int @@ -73,9 +73,9 @@ if2_main (int argc, char *const argv[]) ImageFile* pim_in1; ImageFile* pim_in2; ImageFile* pim_out = NULL; - string in_file1; - string in_file2; - string out_file; + std::string in_file1; + std::string in_file2; + std::string out_file; int opt_verbose = 0; int opt_add = 0; int opt_sub = 0; @@ -126,9 +126,9 @@ if2_main (int argc, char *const argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cout << "Unknown version number" << endl; + std::cout << "Unknown version number\n"; #endif return (0); case O_HELP: @@ -184,7 +184,7 @@ if2_main (int argc, char *const argv[]) vout = pim_out->getArray(); } - string strOperation; + std::string strOperation; int nx = im_in1.nx(); int ny = im_in1.ny(); int nx2 = im_in2.nx(); @@ -221,7 +221,7 @@ if2_main (int argc, char *const argv[]) if (opt_comp) { double d, r, e; im_in1.comparativeStatistics (im_in2, d, r, e); - cout << "d=" << d << ", r=" << r << ", e=" << e << endl; + std::cout << "d=" << d << ", r=" << r << ", e=" << e << std::endl; } if (opt_columnPlot > 0) { if (opt_columnPlot >= nx || opt_columnPlot >= nx2) { @@ -245,7 +245,7 @@ if2_main (int argc, char *const argv[]) ezplot.addCurve (plot_xaxis, v1[opt_columnPlot], im_in1.ny()); ezplot.addCurve (plot_xaxis, v2[opt_columnPlot], im_in2.ny()); ezplot.plot(); - cout << "Press enter to continue" << flush; + std::cout << "Press enter to continue" << flush; cio_kb_getc(); #endif } @@ -279,7 +279,7 @@ if2_main (int argc, char *const argv[]) ezplot.addCurve (plot_xaxis, v1Row, im_in1.nx()); ezplot.addCurve (plot_xaxis, v2Row, im_in2.nx()); ezplot.plot(); - cout << "Press enter to continue" << flush; + std::cout << "Press enter to continue" << flush; cio_kb_getc(); #endif } @@ -303,9 +303,9 @@ main (int argc, char *const argv[]) try { retval = if2_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + cerr << "Unknown exception\n"; } return (retval); diff --git a/tools/if2img.cpp b/tools/if2img.cpp index d17409e..6193704 100644 --- a/tools/if2img.cpp +++ b/tools/if2img.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if2img.cpp,v 1.6 2000/08/25 15:59:13 kevin Exp $ +** $Id: if2img.cpp,v 1.7 2000/12/16 07:28:25 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.6 2000/08/25 15:59:13 kevin Exp $"; +static const char* g_szIdStr = "$Id: if2img.cpp,v 1.7 2000/12/16 07:28:25 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"; @@ -74,42 +74,42 @@ static const char O_FORMAT_DISP_STR[]="disp"; void if2img_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " ifname outfile [OPTIONS]" << endl; - cout << "Convert IF file to an image file" << endl; - cout << endl; - cout << " ifname Name of input file" << endl; - cout << " outfile Name of output file" << endl; - cout << " --format Output format" << endl; - cout << " pgm PGM (portable graymap) format (default)" << endl; - cout << " pgmasc PGM (portable graymap) ASCII format" << endl; + std::cout << "usage: " << fileBasename(program) << " ifname outfile [OPTIONS]\n"; + std::cout << "Convert IF file to an image file\n"; + std::cout << std::endl; + std::cout << " ifname Name of input file\n"; + std::cout << " outfile Name of output file\n"; + std::cout << " --format Output format\n"; + std::cout << " pgm PGM (portable graymap) format (default)\n"; + std::cout << " pgmasc PGM (portable graymap) ASCII format\n"; #ifdef HAVE_PNG - cout << " png PNG (8-bit) format" << endl; - cout << " png16 PNG (16-bit) format" << endl; + std::cout << " png PNG (8-bit) format\n"; + std::cout << " png16 PNG (16-bit) format\n"; #endif #if HAVE_G2 - cout << " gif GIF format" << endl; + std::cout << " gif GIF format\n"; #endif - cout << " disp Display on screen" << endl; - cout << " --center Center of window" << endl; - cout << " median Median is center of window (default)" << endl; - cout << " mode Mode is center of window" << endl; - cout << " mean Mean is center of window" << endl; - cout << " --auto Set auto window" << endl; - cout << " full Use full window (default)" << endl; - cout << " std0.1 Use 0.1 standard deviation about center" << endl; - cout << " std0.5 Use 0.5 standard deviation about center" << endl; - cout << " std1 Use one standard deviation about center" << endl; - cout << " std2 Use two standard deviations about center" << endl; - cout << " std3 Use three standard deviations about center" << endl; - cout << " --scale Scaling factor for output size" << endl; - cout << " --min Set minimum intensity" << endl; - cout << " --max Set maximum intensity" << endl; - cout << " --stats Print image statistics" << endl; - cout << " --labels Print image labels" << endl; - cout << " --debug Set debug mode" << endl; - cout << " --verbose Set verbose mode" << endl; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << " disp Display on screen\n"; + std::cout << " --center Center of window\n"; + std::cout << " median Median is center of window (default)\n"; + std::cout << " mode Mode is center of window\n"; + std::cout << " mean Mean is center of window\n"; + std::cout << " --auto Set auto window\n"; + std::cout << " full Use full window (default)\n"; + std::cout << " std0.1 Use 0.1 standard deviation about center\n"; + std::cout << " std0.5 Use 0.5 standard deviation about center\n"; + std::cout << " std1 Use one standard deviation about center\n"; + std::cout << " std2 Use two standard deviations about center\n"; + std::cout << " std3 Use three standard deviations about center\n"; + std::cout << " --scale Scaling factor for output size\n"; + std::cout << " --min Set minimum intensity\n"; + std::cout << " --max Set maximum intensity\n"; + std::cout << " --stats Print image statistics\n"; + std::cout << " --labels Print image labels\n"; + std::cout << " --debug Set debug mode\n"; + std::cout << " --verbose Set verbose mode\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } @@ -244,9 +244,9 @@ if2img_main (int argc, char *const argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cout << "Unknown version number" << endl; + std::cout << "Unknown version number\n"; #endif return (0); case O_HELP: @@ -284,7 +284,7 @@ if2img_main (int argc, char *const argv[]) } if (opt_labels) - im.printLabels(cout); + im.printLabels(std::cout); if (opt_stats || (! (opt_set_max && opt_set_min))) { double min, max, mean, mode, median, stddev; @@ -317,13 +317,13 @@ if2img_main (int argc, char *const argv[]) } } if (opt_stats) { - cout <<"nx: " << im.nx() << endl; - cout <<"ny: " << im.ny() << endl; - cout <<"min: " << min << endl; - cout <<"max: " << max << endl; - cout <<"mean: " << mean << endl; - cout <<"mode: " << mode << endl; - cout <<"stddev: " << stddev << endl; + std::cout <<"nx: " << im.nx() << std::endl; + std::cout <<"ny: " << im.ny() << std::endl; + std::cout <<"min: " << min << std::endl; + std::cout <<"max: " << max << std::endl; + std::cout <<"mean: " << mean << std::endl; + std::cout <<"mode: " << mode << std::endl; + std::cout <<"stddev: " << stddev << std::endl; } if (opt_auto != O_AUTO_FULL) { double center; @@ -346,8 +346,8 @@ if2img_main (int argc, char *const argv[]) } if (opt_stats) { - cout << "min display: " << densmin << endl; - cout << "max display: " << densmax << endl; + std::cout << "min display: " << densmin << std::endl; + std::cout << "max display: " << densmax << std::endl; } if (opt_format == O_FORMAT_PGM) @@ -367,7 +367,7 @@ if2img_main (int argc, char *const argv[]) else if (opt_format == O_FORMAT_DISP) { #if HAVE_SGP im.displayScaling (opt_scale, densmin, densmax); - cout << "Press enter to continue\n"; + std::cout << "Press enter to continue\n"; cio_kb_getc(); #endif } @@ -389,9 +389,9 @@ main (int argc, char *const argv[]) try { retval = if2img_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + cerr << "Unknown exception\n"; } return (retval); diff --git a/tools/ifinfo.cpp b/tools/ifinfo.cpp index e553be7..1e0aa38 100644 --- a/tools/ifinfo.cpp +++ b/tools/ifinfo.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ifinfo.cpp,v 1.3 2000/08/03 09:57:29 kevin Exp $ +** $Id: ifinfo.cpp,v 1.4 2000/12/16 07:28:25 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -46,32 +46,32 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: ifinfo.cpp,v 1.3 2000/08/03 09:57:29 kevin Exp $"; +static const char* g_szIdStr = "$Id: ifinfo.cpp,v 1.4 2000/12/16 07:28:25 kevin Exp $"; void ifinfo_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " image-filename [OPTIONS]" << endl; - cout << "Imagefile information" << endl; - cout << endl; - cout << " infile Name of input IF file" << endl; - cout << " --display Display image" << endl; - cout << " --labels Print image labels (default)" << endl; - cout << " --no-labels Do not print image labels" << endl; - cout << " --stats Print image statistics (default)" << endl; - cout << " --no-stats Do not print image statistics" << endl; - cout << " --debug Debug mode" << endl; - cout << " --verbose Verbose mode" << endl; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << "usage: " << fileBasename(program) << " image-filename [OPTIONS]\n"; + std::cout << "Imagefile information\n"; + std::cout << std::endl; + std::cout << " infile Name of input IF file\n"; + std::cout << " --display Display image\n"; + std::cout << " --labels Print image labels (default)\n"; + std::cout << " --no-labels Do not print image labels\n"; + std::cout << " --stats Print image statistics (default)\n"; + std::cout << " --no-stats Do not print image statistics\n"; + std::cout << " --debug Debug mode\n"; + std::cout << " --verbose Verbose mode\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } int ifinfo_main (int argc, char *const argv[]) { ImageFile *im = NULL; - string in_file; + std::string in_file; int opt_verbose = 0; int opt_stats = 1; int opt_labels = 1; @@ -106,9 +106,9 @@ ifinfo_main (int argc, char *const argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cout << "Unknown version number" << endl; + std::cout << "Unknown version number\n"; #endif return (0); case O_HELP: @@ -135,11 +135,11 @@ ifinfo_main (int argc, char *const argv[]) } if (opt_labels) - im->printLabels (cout); + im->printLabels (std::cout); if (opt_stats) { - cout << "Size: (" << im->nx() << "," << im->ny() << ")" << endl; - im->printStatistics (cout); + std::cout << "Size: (" << im->nx() << "," << im->ny() << ")\n"; + im->printStatistics (std::cout); } return (0); @@ -154,9 +154,9 @@ main (int argc, char *const argv[]) try { retval = ifinfo_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + cerr << "Unknown exception\n"; } return (retval); diff --git a/tools/phm2if.cpp b/tools/phm2if.cpp index de84572..afc579c 100644 --- a/tools/phm2if.cpp +++ b/tools/phm2if.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phm2if.cpp,v 1.14 2000/11/29 11:12:53 kevin Exp $ +** $Id: phm2if.cpp,v 1.15 2000/12/16 07:28:25 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 @@ -50,53 +50,53 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: phm2if.cpp,v 1.14 2000/11/29 11:12:53 kevin Exp $"; +static const char* g_szIdStr = "$Id: phm2if.cpp,v 1.15 2000/12/16 07:28:25 kevin Exp $"; void phm2if_usage (const char *program) { - cout << "phm2if_usage: " << fileBasename(program) << " outfile nx ny [--phantom phantom-name] [--phmfile filename] [--filter filter-name] [OPTIONS]" << endl; - cout << "Generate phantom image from a predefined --phantom or a --phmfile" << endl; - cout << endl; - cout << " outfile Name of output file for image" << endl; - cout << " nx Number of pixels X-axis" << endl; - cout << " ny Number of pixels Y-axis" << endl; - cout << " --phantom Phantom to use for projection" << endl; - cout << " herman Herman head phantom" << endl; - cout << " herman-b Herman head phantom (Bordered)" << endl; - cout << " shepp-logan Shepp-Logan head phantom" << endl; - cout << " shepp-logan-b Shepp-Logan head phantom (Bordered)" << endl; - cout << " unitpulse Unit pulse phantom" << endl; - cout << " --phmfile Generate Phantom from phantom file" << endl; - cout << " --filter Generate Phantom from a filter function" << endl; - cout << " abs_bandlimit Abs * Bandlimiting" << endl; - cout << " abs_sinc Abs * Sinc" << endl; - cout << " abs_cos Abs * Cosine" << endl; - cout << " abs_hamming Abs * Hamming" << endl; - cout << " shepp Shepp-Logan" << endl; - cout << " bandlimit Bandlimiting" << endl; - cout << " sinc Sinc" << endl; - cout << " cos Cosine" << endl; - cout << " triangle Triangle" << endl; - cout << " hamming Hamming" << endl; - cout << " --filter-param Alpha level for Hamming filter" << endl; - cout << " --filter-domain Set domain of filter" << endl; - cout << " spatial Spatial domain (default)" << endl; - cout << " freq Frequency domain" << endl; - cout << " --filter-bw Filter bandwidth (default = 1)" << endl; - cout << " --desc Description of raysum" << endl; - cout << " --nsample Number of samples per axis per pixel (default = 1)" << endl; - cout << " --trace Trace level to use" << endl; - cout << " none No tracing (default)" << endl; - cout << " console Trace text level" << endl; - cout << " phantom Trace phantom" << endl; - cout << " proj Trace projections" << endl; - cout << " plot Trace plot" << endl; - cout << " clipping Trace clipping" << endl; - cout << " --debug Debug mode" << endl; - cout << " --verbose Verbose mode" << endl; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << "phm2if_usage: " << fileBasename(program) << " outfile nx ny [--phantom phantom-name] [--phmfile filename] [--filter filter-name] [OPTIONS]\n"; + std::cout << "Generate phantom image from a predefined --phantom or a --phmfile\n"; + std::cout << std::endl; + std::cout << " outfile Name of output file for image\n"; + std::cout << " nx Number of pixels X-axis\n"; + std::cout << " ny Number of pixels Y-axis\n"; + std::cout << " --phantom Phantom to use for projection\n"; + std::cout << " herman Herman head phantom\n"; + std::cout << " herman-b Herman head phantom (Bordered)\n"; + std::cout << " shepp-logan Shepp-Logan head phantom\n"; + std::cout << " shepp-logan-b Shepp-Logan head phantom (Bordered)\n"; + std::cout << " unitpulse Unit pulse phantom\n"; + std::cout << " --phmfile Generate Phantom from phantom file\n"; + std::cout << " --filter Generate Phantom from a filter function\n"; + std::cout << " abs_bandlimit Abs * Bandlimiting\n"; + std::cout << " abs_sinc Abs * Sinc\n"; + std::cout << " abs_cos Abs * Cosine\n"; + std::cout << " abs_hamming Abs * Hamming\n"; + std::cout << " shepp Shepp-Logan\n"; + std::cout << " bandlimit Bandlimiting\n"; + std::cout << " sinc Sinc\n"; + std::cout << " cos Cosine\n"; + std::cout << " triangle Triangle\n"; + std::cout << " hamming Hamming\n"; + std::cout << " --filter-param Alpha level for Hamming filter\n"; + std::cout << " --filter-domain Set domain of filter\n"; + std::cout << " spatial Spatial domain (default)\n"; + std::cout << " freq Frequency domain\n"; + std::cout << " --filter-bw Filter bandwidth (default = 1)\n"; + std::cout << " --desc Description of raysum\n"; + std::cout << " --nsample Number of samples per axis per pixel (default = 1)\n"; + std::cout << " --trace Trace level to use\n"; + std::cout << " none No tracing (default)\n"; + std::cout << " console Trace text level\n"; + std::cout << " phantom Trace phantom\n"; + std::cout << " proj Trace projections\n"; + std::cout << " plot Trace plot\n"; + std::cout << " clipping Trace clipping\n"; + std::cout << " --debug Debug mode\n"; + std::cout << " --verbose Verbose mode\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } #ifdef HAVE_MPI @@ -108,12 +108,12 @@ phm2if_main (int argc, char* argv[]) { ImageFile* pImGlobal = NULL; Phantom phm; - string optPhmName; - string optFilterName; - string optDomainName (SignalFilter::convertDomainIDToName (SignalFilter::DOMAIN_SPATIAL)); - string optOutFilename; - string optDesc; - string optPhmFilename; + std::string optPhmName; + std::string optFilterName; + std::string optDomainName (SignalFilter::convertDomainIDToName (SignalFilter::DOMAIN_SPATIAL)); + std::string optOutFilename; + std::string optDesc; + std::string optPhmFilename; int opt_nx = 0; int opt_ny = 0; int opt_nsample = 1; @@ -193,9 +193,9 @@ phm2if_main (int argc, char* argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cerr << "Unknown version number" << endl; + cerr << "Unknown version number\n"; #endif case O_HELP: case '?': @@ -208,7 +208,7 @@ phm2if_main (int argc, char* argv[]) } if (optPhmName == "" && optFilterName == "" && optPhmFilename == "") { - cerr << "No phantom defined" << endl << endl; + cerr << "No phantom defined\n" << std::endl; phm2if_usage(argv[0]); return (1); } @@ -233,7 +233,7 @@ phm2if_main (int argc, char* argv[]) return (1); } - ostringstream oss; + std::ostringstream oss; oss << "phm2if: nx=" << opt_nx << ", ny=" << opt_ny << ", nsample=" << opt_nsample << ", "; if (optPhmFilename != "") oss << "phantomFile=" << optPhmFilename; @@ -249,7 +249,7 @@ phm2if_main (int argc, char* argv[]) if (optPhmName != "") { phm.createFromPhantom (optPhmName.c_str()); if (phm.fail()) { - cout << phm.failMessage() << endl << endl; + std::cout << phm.failMessage() << std::endl << std::endl; phm2if_usage(argv[0]); return (1); } @@ -259,13 +259,13 @@ phm2if_main (int argc, char* argv[]) phm.createFromFile(optPhmFilename.c_str()); #ifdef HAVE_MPI if (mpiWorld.getRank() == 0) - cerr << "Can't use phantom from file in MPI mode" << endl; + cerr << "Can't use phantom from file in MPI mode\n"; return (1); #endif } if (optVerbose) - cout << "Rasterize Phantom to Image" << endl << endl; + std::cout << "Rasterize Phantom to Image\n" << std::endl; #ifdef HAVE_MPI } #endif @@ -348,7 +348,7 @@ phm2if_main (int argc, char* argv[]) pImGlobal->labelAdd (Array2dFileLabel::L_HISTORY, optDesc.c_str(), calctime); pImGlobal->fileWrite (optOutFilename.c_str()); if (optVerbose) - cout << "Time to rasterized phantom: " << calctime << " seconds" << endl; + std::cout << "Time to rasterized phantom: " << calctime << " seconds\n"; if (optTrace >= Trace::TRACE_PHANTOM) { double dmin, dmax; @@ -406,9 +406,9 @@ main (int argc, char* argv[]) try { retval = phm2if_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + cerr << "Unknown exception\n"; } return (retval); diff --git a/tools/phm2pj.cpp b/tools/phm2pj.cpp index f42dd12..80e5566 100644 --- a/tools/phm2pj.cpp +++ b/tools/phm2pj.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phm2pj.cpp,v 1.16 2000/11/24 12:08:10 kevin Exp $ +** $Id: phm2pj.cpp,v 1.17 2000/12/16 07:28:25 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 @@ -50,47 +50,47 @@ static struct option phm2pj_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: phm2pj.cpp,v 1.16 2000/11/24 12:08:10 kevin Exp $"; +static const char* g_szIdStr = "$Id: phm2pj.cpp,v 1.17 2000/12/16 07:28:25 kevin Exp $"; void phm2pj_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " outfile ndet nview [--phantom phantom-name] [--phmfile filename] [OPTIONS]\n"; - cout << "Calculate (projections) through phantom object, either a predefined --phantom or a --phmfile\n\n"; - cout << " outfile Name of output file for projections\n"; - cout << " ndet Number of detectors\n"; - cout << " nview Number of rotated views\n"; - cout << " --phantom Phantom to use for projection\n"; - cout << " herman Herman head phantom\n"; - cout << " herman-b Herman head phantom (Bordered)\n"; - cout << " shepp-logan Shepp-Logan head phantom\n"; - cout << " shepp-logan-b Shepp-Logan head phantom (Bordered)\n"; - cout << " unitpulse Unit pulse phantom\n"; - cout << " --phmfile Get Phantom from phantom file\n"; - cout << " --desc Description of raysum\n"; - cout << " --nray Number of rays per detector (default = 1)\n"; - cout << " --rotangle Degrees to rotate view through (multiple of PI)\n"; - cout << " (default = 1)\n"; - cout << " --geometry Geometry of scanning\n"; - cout << " parallel Parallel scan beams (default)\n"; - cout << " equilinear Equilinear divergent scan beams\n"; - cout << " equiangular Equiangular divergent scan beams\n"; - cout << " --focal-length Focal length ratio (ratio to radius of phantom)\n"; - cout << " (default = 1)\n"; - cout << " --field-of-view Field of view (ratio to diameter of phantom square)\n"; - cout << " (default = 1)\n"; - cout << " --trace Trace level to use\n"; - cout << " none No tracing (default)\n"; - cout << " console Trace text level\n"; - cout << " phantom Trace phantom image\n"; - cout << " proj Trace projections\n"; - cout << " plot Trace plot\n"; - cout << " clipping Trace clipping\n"; - cout << " --verbose Verbose mode\n"; - cout << " --debug Debug mode\n"; - cout << " --version Print version\n"; - cout << " --help Print this help message\n"; + std::cout << "usage: " << fileBasename(program) << " outfile ndet nview [--phantom phantom-name] [--phmfile filename] [OPTIONS]\n"; + std::cout << "Calculate (projections) through phantom object, either a predefined --phantom or a --phmfile\n\n"; + std::cout << " outfile Name of output file for projections\n"; + std::cout << " ndet Number of detectors\n"; + std::cout << " nview Number of rotated views\n"; + std::cout << " --phantom Phantom to use for projection\n"; + std::cout << " herman Herman head phantom\n"; + std::cout << " herman-b Herman head phantom (Bordered)\n"; + std::cout << " shepp-logan Shepp-Logan head phantom\n"; + std::cout << " shepp-logan-b Shepp-Logan head phantom (Bordered)\n"; + std::cout << " unitpulse Unit pulse phantom\n"; + std::cout << " --phmfile Get Phantom from phantom file\n"; + std::cout << " --desc Description of raysum\n"; + std::cout << " --nray Number of rays per detector (default = 1)\n"; + std::cout << " --rotangle Degrees to rotate view through (multiple of PI)\n"; + std::cout << " (default = 1)\n"; + std::cout << " --geometry Geometry of scanning\n"; + std::cout << " parallel Parallel scan beams (default)\n"; + std::cout << " equilinear Equilinear divergent scan beams\n"; + std::cout << " equiangular Equiangular divergent scan beams\n"; + std::cout << " --focal-length Focal length ratio (ratio to radius of phantom)\n"; + std::cout << " (default = 1)\n"; + std::cout << " --field-of-view Field of view (ratio to diameter of phantom square)\n"; + std::cout << " (default = 1)\n"; + std::cout << " --trace Trace level to use\n"; + std::cout << " none No tracing (default)\n"; + std::cout << " console Trace text level\n"; + std::cout << " phantom Trace phantom image\n"; + std::cout << " proj Trace projections\n"; + std::cout << " plot Trace plot\n"; + std::cout << " clipping Trace clipping\n"; + std::cout << " --verbose Verbose mode\n"; + std::cout << " --debug Debug mode\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } #ifdef HAVE_MPI @@ -101,11 +101,11 @@ int phm2pj_main (int argc, char* argv[]) { Phantom phm; - string optGeometryName = Scanner::convertGeometryIDToName(Scanner::GEOMETRY_PARALLEL); + std::string optGeometryName = Scanner::convertGeometryIDToName(Scanner::GEOMETRY_PARALLEL); char *opt_outfile = NULL; - string opt_desc; - string optPhmName; - string optPhmFileName; + std::string opt_desc; + std::string optPhmName; + std::string optPhmFileName; int opt_ndet; int opt_nview; int opt_nray = 1; @@ -197,9 +197,9 @@ phm2pj_main (int argc, char* argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version: " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version: " << VERSION << endl << g_szIdStr << endl; #else - cout << "Unknown version number\n"; + std::cout << "Unknown version number\n"; #endif return (0); case O_HELP: @@ -238,7 +238,7 @@ phm2pj_main (int argc, char* argv[]) return (1); } - ostringstream desc; + std::ostringstream desc; desc << "phm2pj: NDet=" << opt_ndet << ", Nview=" << opt_nview << ", NRay=" << opt_nray << ", RotAngle=" << opt_rotangle << ", Geometry=" << optGeometryName << ", "; if (optPhmFileName.length()) { desc << "PhantomFile=" << optPhmFileName; @@ -253,7 +253,7 @@ phm2pj_main (int argc, char* argv[]) if (optPhmName != "") { phm.createFromPhantom (optPhmName.c_str()); if (phm.fail()) { - cout << phm.failMessage() << endl << endl; + std::cout << phm.failMessage() << endl << endl; phm2pj_usage(argv[0]); return (1); } @@ -290,7 +290,7 @@ phm2pj_main (int argc, char* argv[]) opt_rotangle *= PI; Scanner scanner (phm, optGeometryName.c_str(), opt_ndet, opt_nview, opt_nray, opt_rotangle, dOptFocalLength, dOptFieldOfView); if (scanner.fail()) { - cout << "Scanner Creation Error: " << scanner.failMessage() << endl; + std::cout << "Scanner Creation Error: " << scanner.failMessage() << endl; return (1); } #ifdef HAVE_MPI @@ -301,16 +301,16 @@ phm2pj_main (int argc, char* argv[]) pjGlobal.initFromScanner (scanner); if (opt_verbose) { - ostringstream os; + std::ostringstream os; pjGlobal.printScanInfo(os); - cout << os.str(); + std::cout << os.str(); } Projections pjLocal (scanner); pjLocal.setNView (mpiWorld.getMyLocalWorkUnits()); if (opt_debug) - cout << "pjLocal->nview = " << pjLocal.nView() << " (process " << mpiWorld.getRank() << ")\n";; + std::cout << "pjLocal->nview = " << pjLocal.nView() << " (process " << mpiWorld.getRank() << ")\n";; TimerCollectiveMPI timerProject (mpiWorld.getComm()); scanner.collectProjections (pjLocal, phm, mpiWorld.getMyStartWorkUnit(), mpiWorld.getMyLocalWorkUnits(), false, opt_trace); @@ -333,7 +333,7 @@ phm2pj_main (int argc, char* argv[]) } scanner.collectProjections (pjGlobal, phm, opt_trace, pSGP); if (opt_trace >= Trace::TRACE_PHANTOM) { - cout << "Press enter to continue\n"; + std::cout << "Press enter to continue\n"; cio_kb_getc(); delete pSGP; pSGP = NULL; delete pSGPDriver; pSGPDriver = NULL; @@ -354,12 +354,12 @@ phm2pj_main (int argc, char* argv[]) pjGlobal.write (opt_outfile); if (opt_verbose) { phm.print(); - cout << endl; + std::cout << endl; ostringstream os; pjGlobal.printScanInfo (os); - cout << os.str() << endl; - cout << " Remark: " << pjGlobal.remark() << endl; - cout << "Run time: " << pjGlobal.calcTime() << " seconds\n"; + std::cout << os.str() << endl; + std::cout << " Remark: " << pjGlobal.remark() << endl; + std::cout << "Run time: " << pjGlobal.calcTime() << " seconds\n"; } } diff --git a/tools/pj2if.cpp b/tools/pj2if.cpp index fb3277a..1bbfb11 100644 --- a/tools/pj2if.cpp +++ b/tools/pj2if.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pj2if.cpp,v 1.5 2000/11/22 07:17:06 kevin Exp $ +** $Id: pj2if.cpp,v 1.6 2000/12/16 07:28:25 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 @@ -47,18 +47,18 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: pj2if.cpp,v 1.5 2000/11/22 07:17:06 kevin Exp $"; +static const char* g_szIdStr = "$Id: pj2if.cpp,v 1.6 2000/12/16 07:28:25 kevin Exp $"; void pj2if_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " in-proj-file out-if-file [OPTIONS]" << endl; - cout << "Converts a projection file to a IF file" << endl; - cout << endl; - cout << " --verbose Verbose mode" << endl; - cout << " --dump Dump all scan data" << endl; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << "usage: " << fileBasename(program) << " in-proj-file out-if-file [OPTIONS]\n"; + std::cout << "Converts a projection file to a IF file\n"; + std::cout << std::endl; + std::cout << " --verbose Verbose mode\n"; + std::cout << " --dump Dump all scan data\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } @@ -88,9 +88,9 @@ pj2if_main (const int argc, char *const argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cout << "Unknown version number" << endl; + std::cout << "Unknown version number\n"; #endif return (0); case O_HELP: @@ -120,9 +120,9 @@ pj2if_main (const int argc, char *const argv[]) if (optDump) pj.printProjectionData(); else if (optVerbose) { - ostringstream os; + std::ostringstream os; pj.printScanInfo (os); - cout << os.str(); + std::cout << os.str(); } ImageFile im (pj.nDet(), pj.nView()); @@ -154,9 +154,9 @@ main (const int argc, char *const argv[]) try { retval = pj2if_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + cerr << "Unknown exception\n"; } return (retval); diff --git a/tools/pjinfo.cpp b/tools/pjinfo.cpp index 8a4d0e2..265a9fe 100644 --- a/tools/pjinfo.cpp +++ b/tools/pjinfo.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pjinfo.cpp,v 1.2 2000/12/16 02:31:00 kevin Exp $ +** $Id: pjinfo.cpp,v 1.3 2000/12/16 07:28:25 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 @@ -50,21 +50,21 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.2 2000/12/16 02:31:00 kevin Exp $"; +static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.3 2000/12/16 07:28:25 kevin Exp $"; void pjinfo_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]" << endl; - cout << "Display projection file information" << endl; - cout << "\n"; - cout << " --binaryheader Dump binary header data\n"; - cout << " --binaryviews Dump binary view data\n"; - cout << " --startview n Beginning view number to display (default=0)\n"; - cout << " --endview n Ending view number to display (default=last view)\n"; - cout << " --dump Print all scan data ASCII format\n"; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]\n"; + std::cout << "Display projection file information\n"; + std::cout << "\n"; + std::cout << " --binaryheader Dump binary header data\n"; + std::cout << " --binaryviews Dump binary view data\n"; + std::cout << " --startview n Beginning view number to display (default=0)\n"; + std::cout << " --endview n Ending view number to display (default=last view)\n"; + std::cout << " --dump Print all scan data ASCII format\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } @@ -72,7 +72,7 @@ pjinfo_usage (const char *program) int pjinfo_main (const int argc, char *const argv[]) { - string pj_name; + std::string pj_name; bool optDump = false; bool optBinaryHeader = false; bool optBinaryViews = false; @@ -102,7 +102,7 @@ pjinfo_main (const int argc, char *const argv[]) optStartView = strtol(optarg, &endptr, 10); endstr = optarg + strlen(optarg); if (endptr != endstr) { - cerr << "Error setting --startview to %s" << optarg << endl; + cerr << "Error setting --startview to %s" << optarg << std::endl; pjinfo_usage(argv[0]); return (1); } @@ -111,16 +111,16 @@ pjinfo_main (const int argc, char *const argv[]) optEndView = strtol(optarg, &endptr, 10); endstr = optarg + strlen(optarg); if (endptr != endstr) { - cerr << "Error setting --endview to %s" << optarg << endl; + cerr << "Error setting --endview to %s" << optarg << std::endl; pjinfo_usage(argv[0]); return (1); } break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl << g_szIdStr << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cout << "Unknown version number" << endl; + std::cout << "Unknown version number\n"; #endif return (0); case O_HELP: @@ -141,9 +141,9 @@ pjinfo_main (const int argc, char *const argv[]) pj_name = argv[optind]; if (optBinaryHeader) - Projections::copyHeader (pj_name, cout); + Projections::copyHeader (pj_name, std::cout); else if (optBinaryViews) - Projections::copyViewData (pj_name, cout, optStartView, optEndView); + Projections::copyViewData (pj_name, std::cout, optStartView, optEndView); else { Projections pj; if (! pj.read (pj_name)) { @@ -154,9 +154,9 @@ pjinfo_main (const int argc, char *const argv[]) if (optDump) { pj.printProjectionData (optStartView, optEndView); } else { - ostringstream os; + std::ostringstream os; pj.printScanInfo (os); - cout << os.str(); + std::cout << os.str(); } } @@ -173,9 +173,9 @@ main (const int argc, char *const argv[]) try { retval = pjinfo_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + cerr << "Unknown exception\n"; } return (retval); -- 2.34.1