From: Kevin M. Rosenberg Date: Sat, 16 Dec 2000 06:12:47 +0000 (+0000) Subject: r261: Use explicit std:: namespace X-Git-Tag: debian-4.5.3-3~756 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=dc034c9d0b7d9c3874a324a4c2c189a02945adc8 r261: Use explicit std:: namespace --- diff --git a/getopt/getopt.h b/getopt/getopt.h index 6d73e9f..c5f9861 100644 --- a/getopt/getopt.h +++ b/getopt/getopt.h @@ -126,7 +126,7 @@ struct option arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ -#if defined __STDC__ && __STDC__ +#if defined __STDC__ # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation @@ -152,10 +152,15 @@ extern int _getopt_internal (int __argc, char *const *__argv, #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); # endif #endif /* __STDC__ */ diff --git a/include/array2dfile.h b/include/array2dfile.h index e5276e7..21023dc 100644 --- a/include/array2dfile.h +++ b/include/array2dfile.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.h,v 1.11 2000/12/16 03:29:02 kevin Exp $ +** $Id: array2dfile.h,v 1.12 2000/12/16 06:12:47 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 @@ -44,8 +44,6 @@ #include "fnetorderstream.h" #include "array2d.h" -using namespace std; - class Array2dFileLabel { public: @@ -63,7 +61,7 @@ public: ~Array2dFileLabel(); - const string& getLabelString (void) const + const std::string& getLabelString (void) const { return m_strLabel; } kfloat64 getCalcTime (void) const @@ -78,17 +76,17 @@ public: int getLabelType (void) const { return m_labelType; } - string& setLabelString (const char* const str) + std::string& setLabelString (const char* const str) { m_strLabel = str; return (m_strLabel); } - string& setLabelString (const string& str) + std::string& setLabelString (const std::string& str) { m_strLabel = str; return (m_strLabel); } void setDateTime (int year, int month, int day, int hour, int minute, int second); void getDateTime (int& year, int& month, int& day, int& hour, int& minute, int& second) const; - const string& getDateString () const; + const std::string& getDateString () const; void print (std::ostream& os) const; @@ -106,10 +104,10 @@ private: kuint16 m_hour; kuint16 m_minute; kuint16 m_second; - string m_strLabel; + std::string m_strLabel; kfloat64 m_calcTime; - mutable string m_strDate; + mutable std::string m_strDate; }; @@ -173,26 +171,26 @@ public: bool fileRead (const char* const filename); - bool fileRead (const string& filename); + bool fileRead (const std::string& filename); bool fileWrite (const char* const filename); - bool fileWrite (const string& filename); + bool fileWrite (const std::string& filename); - const string& getFilename (void) const + const std::string& getFilename (void) const { return m_filename; } void printLabels (std::ostream& os) const; - typedef vector::iterator labelIterator; - typedef vector::const_iterator constLabelIterator; + typedef std::vector::iterator labelIterator; + typedef std::vector::const_iterator constLabelIterator; protected: - typedef vector labelContainer; + typedef std::vector labelContainer; static const kuint16 m_signature; kuint16 m_headersize; - string m_filename; + std::string m_filename; kuint16 m_pixelSize; kuint16 m_pixelFormat; diff --git a/include/backprojectors.h b/include/backprojectors.h index c3196f6..4ee4ebb 100644 --- a/include/backprojectors.h +++ b/include/backprojectors.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: backprojectors.h,v 1.17 2000/12/06 01:46:43 kevin Exp $ +** $Id: backprojectors.h,v 1.18 2000/12/16 06:12:47 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 @@ -67,7 +67,7 @@ class Backprojector void BackprojectView (const double* const viewData, const double viewAngle); bool fail() const {return m_fail;} - const string& failMessage() const {return m_failMessage;} + const std::string& failMessage() const {return m_failMessage;} static const int getBackprojectCount() {return s_iBackprojectCount;} static const char** getBackprojectNameArray() {return s_aszBackprojectName;} @@ -85,13 +85,13 @@ class Backprojector private: - string m_nameBackproject; - string m_nameInterpolation; + std::string m_nameBackproject; + std::string m_nameInterpolation; int m_idBackproject; int m_idInterpolation; Backproject* m_pBackprojectImplem; bool m_fail; - string m_failMessage; + std::string m_failMessage; static const char* s_aszBackprojectName[]; static const char* s_aszBackprojectTitle[]; diff --git a/include/ct.h b/include/ct.h index 255e905..e920a56 100644 --- a/include/ct.h +++ b/include/ct.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ct.h,v 1.44 2000/12/16 02:44:26 kevin Exp $ +** $Id: ct.h,v 1.45 2000/12/16 06:12:47 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -52,7 +52,6 @@ #include #include #include -using namespace std; #if defined(MSVC) || HAVE_SSTREAM #include @@ -62,7 +61,7 @@ using namespace std; #include #include -#include +#include #include #include #include diff --git a/include/ctsupport.h b/include/ctsupport.h index 6175543..ba6030d 100644 --- a/include/ctsupport.h +++ b/include/ctsupport.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsupport.h,v 1.12 2000/12/16 03:29:02 kevin Exp $ +** $Id: ctsupport.h,v 1.13 2000/12/16 06:12:47 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -82,7 +82,7 @@ /*----------------------------------------------------------------------*/ -#ifndef O_BINARY +#if !defined(O_BINARY) && !defined(MSVC) #define O_BINARY (0) #endif diff --git a/include/ezplot.h b/include/ezplot.h index c15428b..31291bd 100644 --- a/include/ezplot.h +++ b/include/ezplot.h @@ -7,7 +7,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ezplot.h,v 1.17 2000/12/06 15:17:51 kevin Exp $ +** $Id: ezplot.h,v 1.18 2000/12/16 06:12:47 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 @@ -44,9 +44,9 @@ class EZPlotCurve { int m_iSymbol; int m_iSymbolFreq; int m_iColor; - string m_sLegend; + std::string m_sLegend; - EZPlotCurve (const double* x, const double* y, int n, int color, int linestyle, int symbol, int sumbolFreq, const string& legend); + EZPlotCurve (const double* x, const double* y, int n, int color, int linestyle, int symbol, int sumbolFreq, const std::string& legend); ~EZPlotCurve(); }; @@ -111,15 +111,14 @@ class EZPlotCurve { *---------------------------------------------------------------------------*/ #include -using namespace std; -typedef vector::iterator EZPlotCurveIterator; -typedef vector::const_iterator EZPlotCurveConstIterator; +typedef std::vector::iterator EZPlotCurveIterator; +typedef std::vector::const_iterator EZPlotCurveConstIterator; class SGP; class EZPlot { private: - vector m_vecCurves; + std::vector m_vecCurves; // Colors int clr_axis; // color of all axis lines @@ -133,10 +132,10 @@ class EZPlot { double o_xporigin, o_yporigin; // origin of plot frame in NDC double o_xlength, o_ylength; // length of plot frame in NDC - string c_xlabel; // label for x axis - string c_ylabel; // label for y axis - string c_title; // title to print above graph - string c_legend;; // current legend specified + std::string c_xlabel; // label for x axis + std::string c_ylabel; // label for y axis + std::string c_title; // title to print above graph + std::string c_legend;; // current legend specified int o_linestyle, o_color; // style to use for curves all subsequent curves to EZPLOT int o_xaxis, o_yaxis; // Specifies where axis & labels are drawn diff --git a/include/filter.h b/include/filter.h index d6a3e8f..ca6e67b 100644 --- a/include/filter.h +++ b/include/filter.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: filter.h,v 1.21 2000/11/28 14:54:07 kevin Exp $ +** $Id: filter.h,v 1.22 2000/12/16 06:12:47 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 @@ -77,10 +77,10 @@ class SignalFilter { { return m_adFilter; } bool fail(void) const {return m_fail;} - const string& failMessage(void) const {return m_failMessage;} + const std::string& failMessage(void) const {return m_failMessage;} - const string& nameFilter(void) const { return m_nameFilter;} - const string& nameDomain(void) const { return m_nameDomain;} + const std::string& nameFilter(void) const { return m_nameFilter;} + const std::string& nameDomain(void) const { return m_nameDomain;} const int idFilter(void) const { return m_idFilter;} const int idDomain(void) const { return m_idDomain;} @@ -125,13 +125,13 @@ class SignalFilter { double m_dFilterMax; double* m_adFilter; - string m_nameFilter; - string m_nameDomain; + std::string m_nameFilter; + std::string m_nameDomain; int m_idFilter; int m_idDomain; bool m_fail; - string m_failMessage; + std::string m_failMessage; static const char* s_aszFilterName[]; static const char* s_aszFilterTitle[]; diff --git a/include/fnetorderstream.h b/include/fnetorderstream.h index b682105..a855939 100644 --- a/include/fnetorderstream.h +++ b/include/fnetorderstream.h @@ -1,3 +1,31 @@ +/***************************************************************************** +** FILE IDENTIFICATION +** +** Name: fnetorderstream.h +** Purpose: Network-order file stream header +** Programmer: Kevin Rosenberg +** Date Started: Sep 2000 +** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: fnetorderstream.h,v 1.6 2000/12/16 06:12:47 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 +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ + + #ifndef NETORDER_H #define NETORDER_H @@ -8,7 +36,6 @@ #include #include #include -using namespace std; inline bool NativeBigEndian (void) @@ -65,11 +92,11 @@ SwapBytes8 (void* buffer) void ConvertNetworkOrder (void* buffer, size_t bytes); void ConvertReverseNetworkOrder (void* buffer, size_t bytes); - +using std::fstream; class fnetorderstream : public fstream { public: fnetorderstream (const char* filename, int mode) - : fstream (filename, mode) {} + : fstream (filename, mode) {} ~fnetorderstream (void) {} diff --git a/include/imagefile.h b/include/imagefile.h index dd0c0c9..443bf33 100644 --- a/include/imagefile.h +++ b/include/imagefile.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: imagefile.h,v 1.21 2000/12/16 03:29:02 kevin Exp $ +** $Id: imagefile.h,v 1.22 2000/12/16 06:12:47 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 @@ -39,8 +39,6 @@ #include "fnetorderstream.h" #include "array2dfile.h" -using namespace std; - #ifdef HAVE_MPI #include #endif diff --git a/include/phantom.h b/include/phantom.h index 651e1eb..e30ce87 100644 --- a/include/phantom.h +++ b/include/phantom.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phantom.h,v 1.16 2000/12/06 01:46:43 kevin Exp $ +** $Id: phantom.h,v 1.17 2000/12/16 06:12:47 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 @@ -31,8 +31,6 @@ #include #include "ctsupport.h" -using namespace std; - typedef enum { PELEM_INVALID, PELEM_RECTANGLE, @@ -165,8 +163,8 @@ class Phantom void convertToImagefile (ImageFile& im, const int in_nsample, const int trace) const; bool fail() const {return m_fail;} - const string& failMessage() const {return m_failMessage;} - const string& name() const {return m_name;} + const std::string& failMessage() const {return m_failMessage;} + const std::string& name() const {return m_name;} const int id() const {return m_id;} #if HAVE_SGP @@ -189,8 +187,8 @@ class Phantom const double xmax() const {return m_xmax;} const double ymin() const {return m_ymin;} const double ymax() const {return m_ymax;} - list& listPElem() {return m_listPElem;} - const list& listPElem() const {return m_listPElem;} + std::list& listPElem() {return m_listPElem;} + const std::list& listPElem() const {return m_listPElem;} const int nPElem() const {return m_nPElem;} static const int getPhantomCount() {return s_iPhantomCount;} @@ -205,11 +203,11 @@ class Phantom int m_nPElem; // number of pelems in phantom double m_xmin, m_xmax, m_ymin, m_ymax; // extent of pelems in pelem coordinates double m_diameter; // diameter of object - mutable list m_listPElem; // pelem lists - string m_name; + mutable std::list m_listPElem; // pelem lists + std::string m_name; int m_id; bool m_fail; - string m_failMessage; + std::string m_failMessage; static const char* s_aszPhantomName[]; static const char* s_aszPhantomTitle[]; @@ -221,7 +219,7 @@ class Phantom Phantom& operator= (const Phantom&); // assignment operator }; -typedef list::iterator PElemIterator; -typedef list::const_iterator PElemConstIterator; +typedef std::list::iterator PElemIterator; +typedef std::list::const_iterator PElemConstIterator; #endif diff --git a/include/procsignal.h b/include/procsignal.h index 65bef2a..7a3cb62 100644 --- a/include/procsignal.h +++ b/include/procsignal.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: procsignal.h,v 1.7 2000/12/02 01:29:11 kevin Exp $ +** $Id: procsignal.h,v 1.8 2000/12/16 06:12:47 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 @@ -39,7 +39,6 @@ #include - class SignalFilter; class SGP; @@ -66,7 +65,7 @@ class ProcessSignal { void filterSignal (const float input[], double output[]) const; bool fail(void) const {return m_fail;} - const string& failMessage(void) const {return m_failMessage;} + const std::string& failMessage(void) const {return m_failMessage;} void setTraceLevel (int traceLevel) {m_traceLevel = traceLevel; } @@ -95,9 +94,9 @@ class ProcessSignal { // transforms using direct trigometric calculation static void finiteFourierTransform (const double input[], double output[], const int n, const int direction); - static void finiteFourierTransform (const double input[], complex output[], const int n, const int direction); - static void finiteFourierTransform (const complex input[], complex output[], const int n, const int direction); - static void finiteFourierTransform (const complex input[], double output[], const int n, const int direction); + static void finiteFourierTransform (const double input[], std::complex output[], const int n, const int direction); + static void finiteFourierTransform (const std::complex input[], std::complex output[], const int n, const int direction); + static void finiteFourierTransform (const std::complex input[], double output[], const int n, const int direction); static void shuffleNaturalToFourierOrder (double* pdVector, const int n); @@ -105,8 +104,8 @@ class ProcessSignal { static void shuffleFourierToNaturalOrder (double* pdVector, const int n); private: - string m_nameFilterMethod; - string m_nameFilterGeneration; + std::string m_nameFilterMethod; + std::string m_nameFilterGeneration; int m_idFilterMethod; int m_idFilterGeneration; int m_nSignalPoints; @@ -134,7 +133,7 @@ class ProcessSignal { double m_dFocalLength; bool m_fail; - string m_failMessage; + std::string m_failMessage; static const char* s_aszFilterMethodName[]; static const char* s_aszFilterMethodTitle[]; @@ -154,9 +153,9 @@ class ProcessSignal { // transforms that use precalculated trig tables, therefore don't // require number of data points (n) as an argument - void finiteFourierTransform (const double input[], complex output[], const int direction) const; - void finiteFourierTransform (const complex input[], complex output[], const int direction) const; - void finiteFourierTransform (const complex input[], double output[], const int direction) const; + void finiteFourierTransform (const double input[], std::complex output[], const int direction) const; + void finiteFourierTransform (const std::complex input[], std::complex output[], const int direction) const; + void finiteFourierTransform (const std::complex input[], double output[], const int direction) const; double convolve (const double func[], const double filter[], const double dx, const int n, const int np) const; double convolve (const double f[], const double dx, const int n, const int np) const; diff --git a/include/projections.h b/include/projections.h index eb1c3c7..aa76b1a 100644 --- a/include/projections.h +++ b/include/projections.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: projections.h,v 1.17 2000/12/16 03:29:02 kevin Exp $ +** $Id: projections.h,v 1.18 2000/12/16 06:12:47 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -47,12 +47,12 @@ class Projections void printProjectionData (int startView, int endView); void printProjectionData (); - void printScanInfo (ostringstream& os) const; + void printScanInfo (std::ostringstream& os) const; - bool read (const string& fname); + bool read (const std::string& fname); bool read (const char* fname); bool write (const char* fname); - bool write (const string& fname); + bool write (const std::string& fname); bool detarrayRead (fnetorderstream& fs, DetectorArray& darray, const int view_num); bool detarrayWrite (fnetorderstream& fs, const DetectorArray& darray, const int view_num); @@ -64,7 +64,7 @@ class Projections void setPhmLen (double phmLen) { m_phmLen = phmLen;} void setCalcTime (double calcTime) {m_calcTime = calcTime;} void setRemark (const char* remark) {m_remark = remark; m_label.setLabelString(remark);} - void setRemark (const string& remark) {setRemark(remark.c_str());} + void setRemark (const std::string& remark) {setRemark(remark.c_str());} double detStart() const {return m_detStart;} double rotStart() const {return m_rotStart;} @@ -79,7 +79,7 @@ class Projections double focalLength() const {return m_focalLength;} double fieldOfView() const {return m_fieldOfView;} - const string& getFilename() const {return m_filename;} + const std::string& getFilename() const {return m_filename;} Array2dFileLabel& getLabel() {return m_label;} const Array2dFileLabel& getLabel() const {return m_label;} @@ -90,16 +90,16 @@ class Projections { return (*m_projData[iview]); } static bool copyHeader (const char* const filename, std::ostream& os); - static bool copyHeader (const string& filename, std::ostream& os); + static bool copyHeader (const std::string& filename, std::ostream& os); static bool copyViewData (const char* const filename, std::ostream& os, int startView, int endView); - static bool copyViewData (const string& filename, std::ostream& os, int startView, int endView); + static bool copyViewData (const std::string& filename, std::ostream& os, int startView, int endView); private: int m_headerSize; // Size of disk file header int m_geometry; // Geometry of scanner class DetectorArray **m_projData; // Pointer to array of detarray_st pointers - string m_remark; // description of raysum data + std::string m_remark; // description of raysum data int m_nDet; // number of detectors in array int m_nView; // number of rotated views double m_calcTime; // time required to calculate raysums @@ -116,7 +116,7 @@ class Projections kuint32 m_hour; kuint32 m_minute; kuint32 m_second; - string m_filename; + std::string m_filename; Array2dFileLabel m_label; const static kuint16 m_signature; diff --git a/include/reconstruct.h b/include/reconstruct.h index 422b6c9..70c2ca6 100644 --- a/include/reconstruct.h +++ b/include/reconstruct.h @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: reconstruct.h,v 1.1 2000/09/02 05:13:57 kevin Exp $ +** $Id: reconstruct.h,v 1.2 2000/12/16 06:12:47 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 @@ -43,7 +43,7 @@ public: ~Reconstructor (); bool fail() const {return m_bFail;} - const string& failMessage() const {return m_strFailMessage;} + const std::string& failMessage() const {return m_strFailMessage;} void plotFilter (SGP* pSGP = NULL); @@ -60,7 +60,7 @@ public: int m_iTrace; bool m_bFail; - string m_strFailMessage; + std::string m_strFailMessage; double* m_adPlotXAxis; }; diff --git a/include/sgp.h b/include/sgp.h index 174d83b..36b3b75 100644 --- a/include/sgp.h +++ b/include/sgp.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: sgp.h,v 1.21 2000/12/06 15:17:51 kevin Exp $ +** $Id: sgp.h,v 1.22 2000/12/16 06:12:47 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,13 +47,12 @@ extern "C" { #endif #include -using namespace std; class SGPDriver { private: int m_iPhysicalXSize; int m_iPhysicalYSize; - string m_sWindowTitle; + std::string m_sWindowTitle; int m_idDriver; #ifdef HAVE_WXWINDOWS @@ -82,7 +81,7 @@ public: int getPhysicalYSize () const { return m_iPhysicalYSize; } - const string& getWindowTitle () const + const std::string& getWindowTitle () const { return m_sWindowTitle; } bool isWX () const @@ -184,7 +183,7 @@ public: void lineRel(double x, double y); void moveRel(double x, double y); void drawText(const char *szMessage); - void drawText(const string& rsMessage); + void drawText(const std::string& rsMessage); void polylineAbs(double x[], double y[], int n); void markerAbs (double x, double y); void markerRel(double x, double y); diff --git a/libctgraphics/ezplot.cpp b/libctgraphics/ezplot.cpp index 8d7b516..14c0a5b 100644 --- a/libctgraphics/ezplot.cpp +++ b/libctgraphics/ezplot.cpp @@ -6,7 +6,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ezplot.cpp,v 1.16 2000/12/06 01:46:43 kevin Exp $ +** $Id: ezplot.cpp,v 1.17 2000/12/16 06:12:47 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 @@ -37,7 +37,7 @@ static const double DEF_CHARWIDTH = (1./80.); // size of characters in NDC static const int DEF_CURVE_CLR = C_RED; -EZPlotCurve::EZPlotCurve (const double* xData, const double* yData, int n, int color, int linestyle, int symbol, int symfreq, const string& legend) +EZPlotCurve::EZPlotCurve (const double* xData, const double* yData, int n, int color, int linestyle, int symbol, int symfreq, const std::string& legend) : x(NULL), y(NULL), m_sLegend (legend) { x = new double [n]; diff --git a/libctgraphics/sgp.cpp b/libctgraphics/sgp.cpp index 3626555..ad33f75 100644 --- a/libctgraphics/sgp.cpp +++ b/libctgraphics/sgp.cpp @@ -7,7 +7,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: sgp.cpp,v 1.17 2000/12/06 01:46:43 kevin Exp $ +** $Id: sgp.cpp,v 1.18 2000/12/16 06:12:47 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 @@ -596,7 +596,7 @@ SGP::pointRel (double x, double y) void -SGP::drawText (const string& rsMessage) +SGP::drawText (const std::string& rsMessage) { drawText (rsMessage.c_str()); } diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index b3dc432..6c400ad 100644 --- a/libctsim/array2dfile.cpp +++ b/libctsim/array2dfile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.cpp,v 1.20 2000/12/16 02:44:26 kevin Exp $ +** $Id: array2dfile.cpp,v 1.21 2000/12/16 06:12:47 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 @@ -31,7 +31,6 @@ typedef long off_t; #endif -using namespace std; const kuint16 Array2dFile::m_signature = ('I'*256+'F'); @@ -106,7 +105,7 @@ Array2dFileLabel::getDateTime (int& year, int& month, int& day, int& hour, int& second = m_second; } -const string& +const std::string& Array2dFileLabel::getDateString (void) const { char szDate [128]; @@ -142,16 +141,16 @@ void Array2dFileLabel::print (std::ostream& os) const { if (m_labelType == L_HISTORY) { - os << "History: " << endl; - os << " " << m_strLabel << endl; - os << " calc time = " << m_calcTime << " secs" << endl; - os << " Timestamp = " << getDateString() << endl; + os << "History: " << std::endl; + os << " " << m_strLabel << std::endl; + os << " calc time = " << m_calcTime << " secs" << std::endl; + os << " Timestamp = " << getDateString() << std::endl; } else if (m_labelType == L_USER) { - os << "Note: " << m_strLabel << endl; - os << " Timestamp = %s" << getDateString() << endl; + os << "Note: " << m_strLabel << std::endl; + os << " Timestamp = %s" << getDateString() << std::endl; } else { - os << "Unknown (" << m_labelType << "): " << m_strLabel << endl; - os << " Timestamp = %s" << getDateString() << endl; + os << "Unknown (" << m_labelType << "): " << m_strLabel << std::endl; + os << " Timestamp = %s" << getDateString() << std::endl; } } @@ -242,7 +241,7 @@ Array2dFile::freeArray (void) } bool -Array2dFile::fileWrite (const string& filename) +Array2dFile::fileWrite (const std::string& filename) { return fileWrite (filename.c_str()); } @@ -252,7 +251,7 @@ Array2dFile::fileWrite (const char* const filename) { m_filename = filename; - frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::trunc | ios::binary); + frnetorderstream fs (m_filename.c_str(), std::ios::out | std::ios::in | std::ios::trunc | std::ios::binary); if (fs.fail()) { sys_error (ERR_WARNING, "Error opening file %s for writing [fileCreate]", m_filename.c_str()); return false; @@ -270,7 +269,7 @@ Array2dFile::fileWrite (const char* const filename) } bool -Array2dFile::fileRead (const string& filename) +Array2dFile::fileRead (const std::string& filename) { return fileRead (filename.c_str()); } @@ -281,9 +280,9 @@ Array2dFile::fileRead (const char* const filename) m_filename = filename; #ifdef MSVC - frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary); + frnetorderstream fs (m_filename.c_str(), std::ios::out | std::ios::in | std::ios::binary); #else - frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary | ios::nocreate); + frnetorderstream fs (m_filename.c_str(), std::ios::out | std::ios::in | std::ios::binary | std::ios::nocreate); #endif if (fs.fail()) { sys_error (ERR_WARNING, "Unable to open file %s [fileRead]", m_filename.c_str()); @@ -557,12 +556,12 @@ Array2dFile::labelAdd (const Array2dFileLabel& label) void Array2dFile::labelsCopy (Array2dFile& copyFile, const char* const pszId) { - string id; + std::string id; if (pszId) id = pszId; for (unsigned int i = 0; i < copyFile.getNumLabels(); i++) { Array2dFileLabel l (copyFile.labelGet (i)); - string lstr = l.getLabelString(); + std::string lstr = l.getLabelString(); lstr = id + lstr; l.setLabelString (lstr); labelAdd (l); @@ -580,13 +579,13 @@ Array2dFile::arrayDataClear (void) } void -Array2dFile::printLabels (ostream& os) const +Array2dFile::printLabels (std::ostream& os) const { for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) { const Array2dFileLabel& label = **l; label.print (os); - os << endl; + os << std::endl; } } diff --git a/libctsim/backprojectors.cpp b/libctsim/backprojectors.cpp index 0d3cd80..4e82edd 100644 --- a/libctsim/backprojectors.cpp +++ b/libctsim/backprojectors.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: backprojectors.cpp,v 1.18 2000/12/06 15:17:51 kevin Exp $ +** $Id: backprojectors.cpp,v 1.19 2000/12/16 06:12:47 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 @@ -301,7 +301,7 @@ void Backproject::errorIndexOutsideDetector (int ix, int iy, double theta, doubl void Backproject::errorIndexOutsideDetector (int ix, int iy, double theta, double L, int iDetPos) { #if 1 - ostringstream os; + std::ostringstream os; os << "ix=" << ix << ", iy=" << iy << ", theta=" << theta << ", L=" << L << ", detinc=" << detInc << "\n"; os << "ndet=" << nDet << ", detInc=" << detInc << ", iDetCenter=" << iDetCenter << "\n"; os << "xMin=" << xMin << ", xMax=" << xMax << ", xInc=" << xInc << "\n"; diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index a751573..81de741 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: imagefile.cpp,v 1.19 2000/12/16 02:44:26 kevin Exp $ +** $Id: imagefile.cpp,v 1.20 2000/12/16 06:12:47 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 @@ -193,14 +193,14 @@ ImageFile::comparativeStatistics (const ImageFile& imComp, double& d, double& r, bool -ImageFile::printComparativeStatistics (const ImageFile& imComp, ostream& os) const +ImageFile::printComparativeStatistics (const ImageFile& imComp, std::ostream& os) const { double d, r, e; if (comparativeStatistics (imComp, d, r, e)) { - os << " Normalized root mean squared distance (d): " << d << endl; - os << " Normalized mean absolute distance (r): " << r << endl; - os << "Worst case distance (2x2 pixel average) (e): " << e << endl; + os << " Normalized root mean squared distance (d): " << d << std::endl; + os << " Normalized mean absolute distance (r): " << r << std::endl; + os << "Worst case distance (2x2 pixel average) (e): " << e << std::endl; return true; } return false; @@ -208,18 +208,18 @@ ImageFile::printComparativeStatistics (const ImageFile& imComp, ostream& os) con void -ImageFile::printStatistics (ostream& os) const +ImageFile::printStatistics (std::ostream& os) const { double min, max, mean, mode, median, stddev; statistics (min, max, mean, mode, median, stddev); - os << " min: " << min << endl; - os << " max: " << max << endl; - os << " mean: " << mean << endl; - os << " mode: " << mode << endl; - os << "median: " << median << endl; - os << "stddev: " << stddev << endl; + os << " min: " << min << std::endl; + os << " max: " << max << std::endl; + os << " mean: " << mean << std::endl; + os << " mode: " << mode << std::endl; + os << "median: " << median << std::endl; + os << "stddev: " << stddev << std::endl; } @@ -274,12 +274,12 @@ ImageFile::statistics (double& min, double& max, double& mean, double& mode, dou mode = (max_binindex * spread / (nbin - 1)) + min; int nPixels = nx * ny; - list vecImage; + std::list vecImage; for (int ix5 = 0; ix5 < nx; ix5++) for (int iy = 0; iy < ny; iy++) vecImage.push_front (v[ix5][iy]); vecImage.sort(); - list::const_iterator iter = vecImage.begin(); + std::list::const_iterator iter = vecImage.begin(); for (int i = 0; i < (nPixels / 2) - 1; i++) iter++; // Advance iterator to (nPixels / 2) - 1; diff --git a/libctsim/phantom.cpp b/libctsim/phantom.cpp index 6e3537d..e6d4a62 100644 --- a/libctsim/phantom.cpp +++ b/libctsim/phantom.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: phantom.cpp,v 1.21 2000/12/06 01:46:43 kevin Exp $ +** $Id: phantom.cpp,v 1.22 2000/12/16 06:12:47 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 @@ -311,7 +311,7 @@ Phantom::show () const show (sgp); - cout << "Press return to continue"; + std::cout << "Press return to continue"; cio_kb_getc(); } diff --git a/libctsim/procsignal.cpp b/libctsim/procsignal.cpp index cd44cf8..7bf2711 100644 --- a/libctsim/procsignal.cpp +++ b/libctsim/procsignal.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: procsignal.cpp,v 1.9 2000/12/16 02:44:26 kevin Exp $ +** $Id: procsignal.cpp,v 1.10 2000/12/16 06:12:47 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 @@ -256,7 +256,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw m_nFilterPoints = 1 << nextPowerOf2; #ifdef DEBUG if (m_traceLevel >= Trace::TRACE_CONSOLE) - cout << "nFilterPoints = " << m_nFilterPoints << endl; + std::cout << "nFilterPoints = " << m_nFilterPoints << endl; #endif } m_nOutputPoints = m_nFilterPoints * m_iPreinterpolationFactor; @@ -333,7 +333,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw m_nOutputPoints = m_nFilterPoints * m_iPreinterpolationFactor; #ifdef DEBUG if (m_traceLevel >= Trace::TRACE_CONSOLE) - cout << "nFilterPoints = " << m_nFilterPoints << endl; + std::cout << "nFilterPoints = " << m_nFilterPoints << endl; #endif double* adSpatialFilter = new double [m_nFilterPoints]; SignalFilter filter (m_idFilter, m_dFilterMin, m_dFilterMax, nSpatialPoints, m_dBandwidth, m_dFilterParam, SignalFilter::DOMAIN_SPATIAL); @@ -369,11 +369,11 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw adSpatialFilter[i] = 0; m_adFilter = new double [m_nFilterPoints]; - complex* acInverseFilter = new complex [m_nFilterPoints]; + std::complex* acInverseFilter = new std::complex [m_nFilterPoints]; finiteFourierTransform (adSpatialFilter, acInverseFilter, m_nFilterPoints, 1); delete adSpatialFilter; for (i = 0; i < m_nFilterPoints; i++) - m_adFilter[i] = abs(acInverseFilter[i]) * m_dSignalInc; + m_adFilter[i] = std::abs(acInverseFilter[i]) * m_dSignalInc; delete acInverseFilter; #ifdef HAVE_SGP if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) { @@ -552,7 +552,7 @@ ProcessSignal::filterSignal (const float constInput[], double output[]) const inputSignal[i] = input[i]; for (i = m_nSignalPoints; i < m_nFilterPoints; i++) inputSignal[i] = 0; // zeropad - complex* fftSignal = new complex [m_nFilterPoints]; + std::complex* fftSignal = new std::complex [m_nFilterPoints]; finiteFourierTransform (inputSignal, fftSignal, m_nFilterPoints, -1); delete inputSignal; for (i = 0; i < m_nFilterPoints; i++) @@ -569,7 +569,7 @@ ProcessSignal::filterSignal (const float constInput[], double output[]) const inputSignal[i] = input[i]; for (i = m_nSignalPoints; i < m_nFilterPoints; i++) inputSignal[i] = 0; // zeropad - complex* fftSignal = new complex [m_nFilterPoints]; + std::complex* fftSignal = new std::complex [m_nFilterPoints]; finiteFourierTransform (inputSignal, fftSignal, -1); delete inputSignal; for (i = 0; i < m_nFilterPoints; i++) @@ -686,7 +686,7 @@ for (int i = 0; i < np; i++) void ProcessSignal::finiteFourierTransform (const double input[], double output[], const int n, int direction) { - complex* complexOutput = new complex [n]; + std::complex* complexOutput = new std::complex [n]; finiteFourierTransform (input, complexOutput, n, direction); for (int i = 0; i < n; i++) @@ -695,7 +695,7 @@ ProcessSignal::finiteFourierTransform (const double input[], double output[], co } void -ProcessSignal::finiteFourierTransform (const double input[], complex output[], const int n, int direction) +ProcessSignal::finiteFourierTransform (const double input[], std::complex output[], const int n, int direction) { if (direction < 0) direction = -1; @@ -715,13 +715,13 @@ ProcessSignal::finiteFourierTransform (const double input[], complex out sumReal /= n; sumImag /= n; } - output[i] = complex (sumReal, sumImag); + output[i] = std::complex (sumReal, sumImag); } } void -ProcessSignal::finiteFourierTransform (const complex input[], complex output[], const int n, int direction) +ProcessSignal::finiteFourierTransform (const std::complex input[], std::complex output[], const int n, int direction) { if (direction < 0) direction = -1; @@ -730,10 +730,10 @@ ProcessSignal::finiteFourierTransform (const complex input[], complex sum (0,0); + std::complex sum (0,0); for (int j = 0; j < n; j++) { double angle = i * j * angleIncrement; - complex exponentTerm (cos(angle), sin(angle)); + std::complex exponentTerm (cos(angle), sin(angle)); sum += input[j] * exponentTerm; } if (direction < 0) { @@ -744,7 +744,7 @@ ProcessSignal::finiteFourierTransform (const complex input[], complex input[], double output[], const int n, int direction) +ProcessSignal::finiteFourierTransform (const std::complex input[], double output[], const int n, int direction) { if (direction < 0) direction = -1; @@ -768,7 +768,7 @@ ProcessSignal::finiteFourierTransform (const complex input[], double out // Table-based routines void -ProcessSignal::finiteFourierTransform (const double input[], complex output[], int direction) const +ProcessSignal::finiteFourierTransform (const double input[], std::complex output[], int direction) const { if (direction < 0) direction = -1; @@ -791,13 +791,13 @@ ProcessSignal::finiteFourierTransform (const double input[], complex out sumReal /= m_nFilterPoints; sumImag /= m_nFilterPoints; } - output[i] = complex (sumReal, sumImag); + output[i] = std::complex (sumReal, sumImag); } } // (a+bi) * (c + di) = (ac - bd) + (ad + bc)i void -ProcessSignal::finiteFourierTransform (const complex input[], complex output[], int direction) const +ProcessSignal::finiteFourierTransform (const std::complex input[], std::complex output[], int direction) const { if (direction < 0) direction = -1; @@ -824,12 +824,12 @@ ProcessSignal::finiteFourierTransform (const complex input[], complex (sumReal, sumImag); + output[i] = std::complex (sumReal, sumImag); } } void -ProcessSignal::finiteFourierTransform (const complex input[], double output[], int direction) const +ProcessSignal::finiteFourierTransform (const std::complex input[], double output[], int direction) const { if (direction < 0) direction = -1; diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index 42cc23c..edbed03 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: projections.cpp,v 1.31 2000/12/16 02:54:47 kevin Exp $ +** $Id: projections.cpp,v 1.32 2000/12/16 06:12:47 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 @@ -91,7 +91,7 @@ Projections::initFromScanner (const Scanner& scanner) #if 0 if (m_geometry == Scanner::GEOMETRY_EQUILINEAR) { m_detInc /= 2; - cout << "Kludge: detInc /= 2 in Projections::initFromScanner" << endl; + std::cout << "Kludge: detInc /= 2 in Projections::initFromScanner" << endl; } #endif } @@ -298,7 +298,7 @@ Projections::headerRead (fnetorderstream& fs) } bool -Projections::read (const string& filename) +Projections::read (const std::string& filename) { return read (filename.c_str()); } @@ -330,13 +330,13 @@ Projections::read (const char* filename) bool -Projections::copyViewData (const string& filename, ostream& os, int startView, int endView) +Projections::copyViewData (const std::string& filename, std::ostream& os, int startView, int endView) { return copyViewData (filename.c_str(), os, startView, endView); } bool -Projections::copyViewData (const char* const filename, ostream& os, int startView, int endView) +Projections::copyViewData (const char* const filename, std::ostream& os, int startView, int endView) { frnetorderstream is (filename, ios::in | ios::binary); kuint16 sizeHeader, signature; @@ -388,15 +388,15 @@ Projections::copyViewData (const char* const filename, ostream& os, int startVie } bool -Projections::copyHeader (const string& filename, ostream& os) +Projections::copyHeader (const std::string& filename, std::ostream& os) { return copyHeader (filename.c_str(), os); } bool -Projections::copyHeader (const char* const filename, ostream& os) +Projections::copyHeader (const char* const filename, std::ostream& os) { - frnetorderstream is (filename, ios::in | ios::binary); + frnetorderstream is (filename, std::ios::in | std::ios::binary); kuint16 sizeHeader, signature; is.readInt16 (sizeHeader); is.readInt16 (signature); @@ -423,7 +423,7 @@ Projections::copyHeader (const char* const filename, ostream& os) } bool -Projections::write (const string& filename) +Projections::write (const std::string& filename) { return write (filename.c_str()); } @@ -431,7 +431,7 @@ Projections::write (const string& filename) bool Projections::write (const char* filename) { - frnetorderstream fs (filename, ios::out | ios::binary | ios::trunc | ios::ate); + frnetorderstream fs (filename, std::ios::out | std::ios::binary | std::ios::trunc | std::ios::ate); m_filename = filename; if (! fs) { sys_error (ERR_SEVERE, "Error opening file %s for output [projections_create]", filename); @@ -591,7 +591,7 @@ Projections::printProjectionData (int startView, int endView) } void -Projections::printScanInfo (ostringstream& os) const +Projections::printScanInfo (std::ostringstream& os) const { os << "Number of detectors: " << m_nDet << "\n"; os << " Number of views: " << m_nView<< "\n"; diff --git a/libctsim/reconstruct.cpp b/libctsim/reconstruct.cpp index 591aed2..7a27208 100644 --- a/libctsim/reconstruct.cpp +++ b/libctsim/reconstruct.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: reconstruct.cpp,v 1.3 2000/12/16 02:44:26 kevin Exp $ +** $Id: reconstruct.cpp,v 1.4 2000/12/16 06:12:47 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 @@ -147,7 +147,7 @@ Reconstructor::reconstructView (int iStartView, int iViewCount, SGP* pSGP) for (int iView = iStartView; iView < (iStartView + iViewCount); iView++) { if (m_iTrace == Trace::TRACE_CONSOLE) - cout <<"Reconstructing view " << iView << " (last = " << m_rProj.nView() - 1 << ")\n"; + std::cout <<"Reconstructing view " << iView << " (last = " << m_rProj.nView() - 1 << ")\n"; const DetectorArray& rDetArray = m_rProj.getDetectorArray (iView); const DetectorValue* detval = rDetArray.detValues(); diff --git a/libctsim/scanner.cpp b/libctsim/scanner.cpp index cf6c78c..59bcf94 100644 --- a/libctsim/scanner.cpp +++ b/libctsim/scanner.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: scanner.cpp,v 1.19 2000/12/16 02:44:26 kevin Exp $ +** $Id: scanner.cpp,v 1.20 2000/12/16 06:12:47 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 @@ -365,7 +365,7 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iS traceShowParam ("Current View:", "%d (%.0f%%)", PROJECTION_TRACE_ROW_CURR_VIEW, C_RED, iView + iStartView, (iView + iStartView) / static_cast(m_nView) * 100.); #endif if (m_trace == Trace::TRACE_CONSOLE) - cout << "Current View: " << iView+iStartView << endl; + std::cout << "Current View: " << iView+iStartView << std::endl; projectSingleView (phm, detArray, xd1, yd1, xd2, yd2, xs1, ys1, xs2, ys2, viewAngle + 3 * HALFPI); detArray.setViewAngle (viewAngle); diff --git a/libctsupport/msvc.cpp b/libctsupport/msvc.cpp index 02266ae..99e1caa 100644 --- a/libctsupport/msvc.cpp +++ b/libctsupport/msvc.cpp @@ -2,7 +2,7 @@ // Work around bug in VC6 #ifdef MSVC -const struct fpos_t std::_Fpz = {0, 0}; +const fpos_t std::_Fpz = 0; #endif diff --git a/src/ctsim.cpp b/src/ctsim.cpp index d07eb2b..95894c1 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.15 2000/12/16 03:39:06 kevin Exp $ +** $Id: ctsim.cpp,v 1.16 2000/12/16 06:12:47 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 @@ -24,40 +24,44 @@ ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -#if !wxUSE_DOC_VIEW_ARCHITECTURE -#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h! -#endif - -#include "wx/docview.h" + + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +#if !wxUSE_DOC_VIEW_ARCHITECTURE +#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h! +#endif + +#include "ct.h" #include "ctsim.h" #include "docs.h" #include "views.h" #include "dialogs.h" -#include "ctsupport.h" + #if defined(HAVE_CONFIG_H) #include "config.h" -#endif +#endif + #if defined(HAVE_GETOPT_H) || defined(HAVE_GETOPT_LONG) #ifdef MSVC #define __STDC__ 1 +#endif #include "getopt.h" +#ifdef MSVC #undef __STDC__ #endif #endif - -static const char* rcsindent = "$Id: ctsim.cpp,v 1.15 2000/12/16 03:39:06 kevin Exp $"; + +static const char* rcsindent = "$Id: ctsim.cpp,v 1.16 2000/12/16 06:12:47 kevin Exp $"; class CTSimApp* theApp = NULL; diff --git a/src/ctsim.h b/src/ctsim.h index 62d97c2..976de33 100644 --- a/src/ctsim.h +++ b/src/ctsim.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.h,v 1.7 2000/12/16 03:29:02 kevin Exp $ +** $Id: ctsim.h,v 1.8 2000/12/16 06:12:47 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 @@ -28,7 +28,6 @@ #ifndef __CTSIMH__ #define __CTSIMH__ -#include "wx/docview.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -38,6 +37,7 @@ class wxMenu; class wxDocument; +#include "wx/docview.h" // Define a new frame for main window class MainFrame: public wxDocParentFrame diff --git a/src/dialogs.cpp b/src/dialogs.cpp index 87542a9..6f55dea 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: dialogs.cpp,v 1.14 2000/12/16 03:29:02 kevin Exp $ +** $Id: dialogs.cpp,v 1.15 2000/12/16 06:12:47 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 @@ -122,10 +122,10 @@ DialogGetImageMinMax::DialogGetImageMinMax (wxFrame* pParent, const ImageFile& r pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << dDefaultMin; m_pTextCtrlMin = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osMax; + std::ostringstream osMax; osMax << dDefaultMax; m_pTextCtrlMax = new wxTextCtrl (this, -1, osMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -198,13 +198,13 @@ DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDef pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << iDefaultXSize; m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osYSize; + std::ostringstream osYSize; osYSize << iDefaultYSize; m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osNSamples; + std::ostringstream osNSamples; osNSamples << iDefaultNSamples; m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -299,22 +299,22 @@ DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent, pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << iDefaultNDet; m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osNView; + std::ostringstream osNView; osNView << iDefaultNView; m_pTextCtrlNView = new wxTextCtrl (this, -1, osNView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osNSamples; + std::ostringstream osNSamples; osNSamples << iDefaultNSamples; m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osRotAngle; + std::ostringstream osRotAngle; osRotAngle << dDefaultRotAngle; m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osFocalLength; + std::ostringstream osFocalLength; osFocalLength << dDefaultFocalLength; m_pTextCtrlFocalLength = new wxTextCtrl (this, -1, osFocalLength.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osFieldOfView; + std::ostringstream osFieldOfView; osFieldOfView << dDefaultFieldOfView; m_pTextCtrlFieldOfView = new wxTextCtrl (this, -1, osFieldOfView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -463,19 +463,19 @@ DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* p pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << iDefaultXSize; m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osYSize; + std::ostringstream osYSize; osYSize << iDefaultYSize; m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osFilterParam; + std::ostringstream osFilterParam; osFilterParam << dDefaultFilterParam; m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osZeropad; + std::ostringstream osZeropad; osZeropad << iDefaultZeropad; m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osInterpParam; + std::ostringstream osInterpParam; osInterpParam << iDefaultInterpParam; m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -665,7 +665,7 @@ DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, const Im wxGridSizer *pGridSizer = new wxGridSizer (2); pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - ostringstream osDefaultFactor; + std::ostringstream osDefaultFactor; osDefaultFactor << dDefaultScaleFactor; m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, osDefaultFactor.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); pGridSizer->Add (m_pTextCtrlStdDevFactor, 0, wxALIGN_CENTER_VERTICAL); diff --git a/src/docs.cpp b/src/docs.cpp index 6722ef5..034cfe7 100644 --- a/src/docs.cpp +++ b/src/docs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: docs.cpp,v 1.3 2000/09/07 01:28:33 kevin Exp $ +** $Id: docs.cpp,v 1.4 2000/12/16 06:12:47 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 @@ -51,7 +51,6 @@ #include "docs.h" #include "views.h" - // ImageFileDocument IMPLEMENT_DYNAMIC_CLASS(ImageFileDocument, wxDocument) diff --git a/src/views.cpp b/src/views.cpp index e94ca25..cd16c7c 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: views.cpp,v 1.24 2000/12/16 03:29:02 kevin Exp $ +** $Id: views.cpp,v 1.25 2000/12/16 06:12:47 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 @@ -25,10 +25,6 @@ ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ -#ifdef __GNUG__ -// #pragma implementation -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -97,7 +93,7 @@ ImageFileCanvas::OnMouseEvent(wxMouseEvent& event) int ny = rIF.ny(); if (pt.x >= 0 && pt.x < nx && pt.y >= 0 && pt.y < ny) { - ostringstream os; + std::ostringstream os; os << "Image value (" << pt.x << "," << pt.y << ") = " << v[pt.x][ny - 1 - pt.y] << "\n"; *theApp->getLog() << os.str().c_str(); } else @@ -134,9 +130,9 @@ ImageFileView::OnProperties (wxCommandEvent& event) if (rIF.nx() == 0 || rIF.ny() == 0) *theApp->getLog() << "Properties: empty imagefile\n"; else { - const string& rFilename = rIF.getFilename(); + const std::string& rFilename = rIF.getFilename(); rIF.statistics (min, max, mean, mode, median, stddev); - ostringstream os; + std::ostringstream os; os << "file: " << rFilename << "\nmin: "<getLog() << os.str().c_str(); wxMessageDialog dialogMsg (m_frame, os.str().c_str(), "Imagefile Properties", wxOK | wxICON_INFORMATION); @@ -397,7 +393,7 @@ PhantomView::OnProperties (wxCommandEvent& event) { const int idPhantom = GetDocument()->getPhantomID(); const wxString& namePhantom = GetDocument()->getPhantomName(); - ostringstream os; + std::ostringstream os; os << "Phantom " << namePhantom.c_str() << " (" << idPhantom << ")\n"; *theApp->getLog() << os.str().c_str(); #if DEBUG @@ -462,7 +458,7 @@ PhantomView::OnProjections (wxCommandEvent& event) } } - ostringstream os; + std::ostringstream os; os << "Projections for " << rPhantom.name() << ": nDet=" << m_iDefaultNDet << ", nView=" << m_iDefaultNView << ", nSamples=" << m_iDefaultNSample << ", RotAngle=" << m_dDefaultRotation << ", FocalLengthRatio=" << m_dDefaultFocalLength << ", FieldOfViewRatio=" << m_dDefaultFieldOfView << ", Geometry=" << sGeometry.c_str() << "\n"; rProj.setRemark (os.str()); *theApp->getLog() << os.str().c_str(); @@ -512,7 +508,7 @@ PhantomView::OnRasterize (wxCommandEvent& event) pRasterDoc->Modify(true); pRasterDoc->UpdateAllViews(this); - ostringstream os; + std::ostringstream os; os << "Rasterize Phantom " << rPhantom.name() << ": XSize=" << xSize << ", YSize=" << ySize << ", nSamples=" << nSamples << "\n"; *theApp->getLog() << os.str().c_str(); } @@ -695,7 +691,7 @@ void ProjectionFileView::OnProperties (wxCommandEvent& event) { const Projections& rProj = GetDocument()->getProjections(); - ostringstream os; + std::ostringstream os; rProj.printScanInfo(os); *theApp->getLog() << os.str().c_str(); wxMessageDialog dialogMsg (m_frame, os.str().c_str(), "Projection File Properties", wxOK | wxICON_INFORMATION); @@ -788,7 +784,7 @@ ProjectionFileView::OnReconstruct (wxCommandEvent& event) delete pReconstruct; pReconDoc->Modify(true); pReconDoc->UpdateAllViews(this); - ostringstream os; + std::ostringstream os; os << "Reconstruct " << rProj.getFilename() << ": xSize=" << m_iDefaultNX << ", ySize=" << m_iDefaultNY << ", Filter=" << optFilterName.c_str() << ", FilterParam=" << m_dDefaultFilterParam << ", FilterMethod=" << optFilterMethodName.c_str() << ", FilterGeneration=" << optFilterGenerationName.c_str() << ", Zeropad=" << m_iDefaultZeropad << ", Interpolation=" << optInterpName.c_str() << ", InterpolationParam=" << m_iDefaultInterpParam << ", Backprojection=" << optBackprojectName.c_str() << "\n"; *theApp->getLog() << os.str().c_str(); imageFile.labelAdd (rProj.getLabel()); diff --git a/tools/pjrec.cpp b/tools/pjrec.cpp index 841a198..d87a76d 100644 --- a/tools/pjrec.cpp +++ b/tools/pjrec.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pjrec.cpp,v 1.18 2000/12/16 02:44:26 kevin Exp $ +** $Id: pjrec.cpp,v 1.19 2000/12/16 06:12:47 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -49,70 +49,70 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.18 2000/12/16 02:44:26 kevin Exp $"; - +static const char* g_szIdStr = "$Id: pjrec.cpp,v 1.19 2000/12/16 06:12:47 kevin Exp $"; + void pjrec_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " raysum-file image-file nx-image ny-image [OPTIONS]" << endl; - cout << "Image reconstruction from raysum projections" << endl; - cout << endl; - cout << " raysum-file Input raysum file" << endl; - cout << " image-file Output image file in SDF2D format" << endl; - cout << " nx-image Number of columns in output image" << endl; - cout << " ny-image Number of rows in output image" << endl; - cout << " --interp Interpolation method during backprojection" << endl; - cout << " nearest Nearest neighbor interpolation" << endl; - cout << " linear Linear interpolation" << endl; + std::cout << "usage: " << fileBasename(program) << " raysum-file image-file nx-image ny-image [OPTIONS]" << std::endl; + std::cout << "Image reconstruction from raysum projections" << std::endl; + std::cout << std::endl; + std::cout << " raysum-file Input raysum file" << std::endl; + std::cout << " image-file Output image file in SDF2D format" << std::endl; + std::cout << " nx-image Number of columns in output image" << std::endl; + std::cout << " ny-image Number of rows in output image" << std::endl; + std::cout << " --interp Interpolation method during backprojection" << std::endl; + std::cout << " nearest Nearest neighbor interpolation" << std::endl; + std::cout << " linear Linear interpolation" << std::endl; #if HAVE_BSPLINE_INTERP - cout << " bspline B-spline interpolation" << endl; + std::cout << " bspline B-spline interpolation" << std::endl; #endif - cout << " --preinterpolate Preinterpolation factor (default = 1)\n"; - cout << " Used only with frequency-based filtering\n"; - cout << " --filter Filter name" << endl; - cout << " abs_bandlimit Abs * Bandlimiting (default)" << endl; - cout << " abs_sinc Abs * Sinc" << endl; - cout << " abs_cosine Abs * Cosine" << endl; - cout << " abs_hamming Abs * Hamming" << endl; - cout << " shepp Shepp-Logan" << endl; - cout << " bandlimit Bandlimiting" << endl; - cout << " sinc Sinc" << endl; - cout << " cosine Cosine" << endl; - cout << " triangle Triangle" << endl; - cout << " hamming Hamming" << endl; - cout << " --filter-method Filter method before backprojections\n";; - cout << " convolution Spatial filtering (default)\n"; - cout << " fourier Frequency filtering with discete fourier\n"; - cout << " fourier_table Frequency filtering with table lookup fourier\n"; - cout << " fft Fast Fourier Transform\n"; + std::cout << " --preinterpolate Preinterpolation factor (default = 1)\n"; + std::cout << " Used only with frequency-based filtering\n"; + std::cout << " --filter Filter name" << std::endl; + std::cout << " abs_bandlimit Abs * Bandlimiting (default)" << std::endl; + std::cout << " abs_sinc Abs * Sinc" << std::endl; + std::cout << " abs_cosine Abs * Cosine" << std::endl; + std::cout << " abs_hamming Abs * Hamming" << std::endl; + std::cout << " shepp Shepp-Logan" << std::endl; + std::cout << " bandlimit Bandlimiting" << std::endl; + std::cout << " sinc Sinc" << std::endl; + std::cout << " cosine Cosine" << std::endl; + std::cout << " triangle Triangle" << std::endl; + std::cout << " hamming Hamming" << std::endl; + std::cout << " --filter-method Filter method before backprojections\n";; + std::cout << " convolution Spatial filtering (default)\n"; + std::cout << " fourier Frequency filtering with discete fourier\n"; + std::cout << " fourier_table Frequency filtering with table lookup fourier\n"; + std::cout << " fft Fast Fourier Transform\n"; #if HAVE_FFTW - cout << " fftw Fast Fourier Transform West library\n"; - cout << " rfftw Fast Fourier Transform West (real-mode) library\n"; + std::cout << " fftw Fast Fourier Transform West library\n"; + std::cout << " rfftw Fast Fourier Transform West (real-mode) library\n"; #endif - cout << " --zeropad n Set zeropad level (default = 0)\n"; - cout << " set n to number of powers to two to pad\n"; - cout << " --filter-generation Filter Generation mode\n"; - cout << " direct Use direct filter in spatial or frequency domain (default)\n"; - cout << " inverse_fourier Use inverse fourier transform of inverse filter\n"; - cout << " --backproj Backprojection Method" << endl; - cout << " trig Trigometric functions at every point" << endl; - cout << " table Trigometric functions with precalculated table" << endl; - 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; - cout << " console Text level tracing" << endl; - cout << " phantom Trace phantom" << endl; - cout << " proj Trace allrays" << endl; - cout << " plot Trace plotting" << endl; - cout << " clipping Trace clipping" << endl; - cout << " --verbose Turn on verbose mode" << endl; - cout << " --debug Turn on debug mode" << endl; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << " --zeropad n Set zeropad level (default = 0)\n"; + std::cout << " set n to number of powers to two to pad\n"; + std::cout << " --filter-generation Filter Generation mode\n"; + std::cout << " direct Use direct filter in spatial or frequency domain (default)\n"; + std::cout << " inverse_fourier Use inverse fourier transform of inverse filter\n"; + std::cout << " --backproj Backprojection Method" << std::endl; + std::cout << " trig Trigometric functions at every point" << std::endl; + std::cout << " table Trigometric functions with precalculated table" << std::endl; + std::cout << " diff Difference method" << std::endl; + std::cout << " diff2 Optimized difference method (default)" << std::endl; + std::cout << " idiff2 Optimized difference method with integer math" << std::endl; + std::cout << " idiff3 Highly-optimized difference method with integer math" << std::endl; + std::cout << " --filter-param Alpha level for Hamming filter" << std::endl; + std::cout << " --trace Set tracing to level" << std::endl; + std::cout << " none No tracing (default)" << std::endl; + std::cout << " console Text level tracing" << std::endl; + std::cout << " phantom Trace phantom" << std::endl; + std::cout << " proj Trace allrays" << std::endl; + std::cout << " plot Trace plotting" << std::endl; + std::cout << " clipping Trace clipping" << std::endl; + std::cout << " --verbose Turn on verbose mode" << std::endl; + std::cout << " --debug Turn on debug mode" << std::endl; + std::cout << " --version Print version" << std::endl; + std::cout << " --help Print this help message" << std::endl; } @@ -129,17 +129,17 @@ pjrec_main (int argc, char * argv[]) ImageFile* imGlobal = NULL; char* pszFilenameProj = NULL; char* pszFilenameImage = NULL; - string sRemark; + std::string sRemark; bool bOptVerbose = false; bool bOptDebug = 1; int iOptZeropad = 1; int optTrace = Trace::TRACE_NONE; double dOptFilterParam = -1; - string sOptFilterName (SignalFilter::convertFilterIDToName (SignalFilter::FILTER_ABS_BANDLIMIT)); - string sOptFilterMethodName (ProcessSignal::convertFilterMethodIDToName (ProcessSignal::FILTER_METHOD_CONVOLUTION)); - string sOptFilterGenerationName (ProcessSignal::convertFilterGenerationIDToName (ProcessSignal::FILTER_GENERATION_DIRECT)); - string sOptInterpName (Backprojector::convertInterpIDToName (Backprojector::INTERP_LINEAR)); - string sOptBackprojectName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF3)); + std::string sOptFilterName (SignalFilter::convertFilterIDToName (SignalFilter::FILTER_ABS_BANDLIMIT)); + std::string sOptFilterMethodName (ProcessSignal::convertFilterMethodIDToName (ProcessSignal::FILTER_METHOD_CONVOLUTION)); + std::string sOptFilterGenerationName (ProcessSignal::convertFilterGenerationIDToName (ProcessSignal::FILTER_GENERATION_DIRECT)); + std::string sOptInterpName (Backprojector::convertInterpIDToName (Backprojector::INTERP_LINEAR)); + std::string sOptBackprojectName (Backprojector::convertBackprojectIDToName (Backprojector::BPROJ_IDIFF3)); int iOptPreinterpolationFactor = 1; int nx, ny; char *endptr; @@ -214,9 +214,9 @@ pjrec_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 - cout << "Unknown version number" << endl; + std::cout << "Unknown version number" << std::endl; #endif return (0); case O_HELP: @@ -241,18 +241,18 @@ pjrec_main (int argc, char * argv[]) nx = strtol(argv[optind + 2], &endptr, 10); ny = strtol(argv[optind + 3], &endptr, 10); - ostringstream filterDesc; + std::ostringstream filterDesc; if (dOptFilterParam >= 0) filterDesc << sOptFilterName << ": alpha=" << dOptFilterParam; else filterDesc << sOptFilterName; - ostringstream label; + std::ostringstream label; label << "pjrec: " << nx << "x" << ny << ", " << filterDesc.str() << ", " << sOptInterpName << ", preinterpolationFactor=" << iOptPreinterpolationFactor << ", " << sOptBackprojectName; sRemark = label.str(); if (bOptVerbose) - cout << "SRemark: " << sRemark << endl; + std::cout << "SRemark: " << sRemark << std::endl; #ifdef HAVE_MPI } #endif @@ -263,7 +263,7 @@ pjrec_main (int argc, char * argv[]) if (bOptVerbose) { ostringstream os; projGlobal.printScanInfo (os); - cout << os.str(); + std::cout << os.str(); } mpi_ndet = projGlobal.nDet(); @@ -314,9 +314,9 @@ pjrec_main (int argc, char * argv[]) #else projGlobal.read (pszFilenameProj); if (bOptVerbose) { - ostringstream os; + std::ostringstream os; projGlobal.printScanInfo(os); - cout << os.str(); + std::cout << os.str(); } imGlobal = new ImageFile (nx, ny); @@ -327,7 +327,7 @@ pjrec_main (int argc, char * argv[]) Reconstructor reconstruct (projLocal, *imLocal, sOptFilterName.c_str(), dOptFilterParam, sOptFilterMethodName.c_str(), iOptZeropad, sOptFilterGenerationName.c_str(), sOptInterpName.c_str(), iOptPreinterpolationFactor, sOptBackprojectName.c_str(), optTrace); if (reconstruct.fail()) { - cout << reconstruct.failMessage(); + std::cout << reconstruct.failMessage(); return (1); } reconstruct.reconstructAllViews(); @@ -342,7 +342,7 @@ pjrec_main (int argc, char * argv[]) #else Reconstructor reconstruct (projGlobal, *imGlobal, sOptFilterName.c_str(), dOptFilterParam, sOptFilterMethodName.c_str(), iOptZeropad, sOptFilterGenerationName.c_str(), sOptInterpName.c_str(), iOptPreinterpolationFactor, sOptBackprojectName.c_str(), optTrace); if (reconstruct.fail()) { - cout << reconstruct.failMessage(); + std::cout << reconstruct.failMessage(); return (1); } reconstruct.reconstructAllViews(); @@ -357,7 +357,7 @@ pjrec_main (int argc, char * argv[]) imGlobal->labelAdd (Array2dFileLabel::L_HISTORY, sRemark.c_str(), dCalcTime); imGlobal->fileWrite (pszFilenameImage); if (bOptVerbose) - cout << "Run time: " << dCalcTime << " seconds" << endl; + std::cout << "Run time: " << dCalcTime << " seconds" << std::endl; } #ifdef HAVE_MPI MPI::Finalize(); @@ -430,9 +430,9 @@ main (int argc, char* argv[]) try { retval = pjrec_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + std::cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + std::cerr << "Unknown exception" << std::endl; } return (retval);