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\r
+
2.0.6 - 12/03/00
Fixed minor compilation problem with procsignal.h
Updated README file
** 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
{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
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:
out_file = argv[optind + 1];
- string histString;
+ std::string histString;
if (opt_invert || opt_log || opt_exp || opt_sqr || opt_sqrt) {
int ix, iy;
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);
** 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
{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
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;
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:
vout = pim_out->getArray();
}
- string strOperation;
+ std::string strOperation;
int nx = im_in1.nx();
int ny = im_in1.ny();
int nx2 = im_in2.nx();
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) {
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
}
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
}
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);
** 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
{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";
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";
}
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:
}
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;
}
}
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;
}
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)
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
}
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);
** 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
{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;
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:
}
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);
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);
** 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
{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
{
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;
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 '?':
}
if (optPhmName == "" && optFilterName == "" && optPhmFilename == "") {
- cerr << "No phantom defined" << endl << endl;
+ cerr << "No phantom defined\n" << std::endl;
phm2if_usage(argv[0]);
return (1);
}
return (1);
}
- ostringstream oss;
+ std::ostringstream oss;
oss << "phm2if: nx=" << opt_nx << ", ny=" << opt_ny << ", nsample=" << opt_nsample << ", ";
if (optPhmFilename != "")
oss << "phantomFile=" << optPhmFilename;
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);
}
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
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;
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);
** 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
{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
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;
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:
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;
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);
}
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
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);
}
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;
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";
}
}
** 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
{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";
}
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:
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());
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);
** 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
{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";
}
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;
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);
}
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:
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)) {
if (optDump) {
pj.printProjectionData (optStartView, optEndView);
} else {
- ostringstream os;
+ std::ostringstream os;
pj.printScanInfo (os);
- cout << os.str();
+ std::cout << os.str();
}
}
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);