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
#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,\r
+ const struct option *longopts, int *longind);\r
+extern int getopt_long_only (int __argc, char *const *__argv,\r
+ const char *__shortopts,\r
+ const struct option *__longopts, int *__longind);\r
+extern int _getopt_internal (int __argc, char *const *__argv,\r
+ const char *__shortopts,\r
+ const struct option *__longopts, int *__longind,\r
+ int __long_only);\r
# endif
#endif /* __STDC__ */
** 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
#include "fnetorderstream.h"
#include "array2d.h"
-using namespace std;
-
class Array2dFileLabel
{
public:
~Array2dFileLabel();
- const string& getLabelString (void) const
+ const std::string& getLabelString (void) const
{ return m_strLabel; }
kfloat64 getCalcTime (void) const
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;
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;
};
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<Array2dFileLabel*>::iterator labelIterator;
- typedef vector<Array2dFileLabel*>::const_iterator constLabelIterator;
+ typedef std::vector<Array2dFileLabel*>::iterator labelIterator;
+ typedef std::vector<Array2dFileLabel*>::const_iterator constLabelIterator;
protected:
- typedef vector<Array2dFileLabel*> labelContainer;
+ typedef std::vector<Array2dFileLabel*> labelContainer;
static const kuint16 m_signature;
kuint16 m_headersize;
- string m_filename;
+ std::string m_filename;
kuint16 m_pixelSize;
kuint16 m_pixelFormat;
** 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
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;}
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[];
** 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
#include <cstddef>
#include <cstdarg>
#include <cstdlib>
-using namespace std;
\r
#if defined(MSVC) || HAVE_SSTREAM\r
#include <sstream>
\r
#include <fstream>
#include <iostream>
-#include <string>
+#include <string>\r
#include <iterator>
#include <algorithm>
#include <exception>
** 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
/*----------------------------------------------------------------------*/
-#ifndef O_BINARY
+#if !defined(O_BINARY) && !defined(MSVC)
#define O_BINARY (0)
#endif
** 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
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();
};
*---------------------------------------------------------------------------*/
#include <vector>
-using namespace std;
-typedef vector<EZPlotCurve*>::iterator EZPlotCurveIterator;
-typedef vector<EZPlotCurve*>::const_iterator EZPlotCurveConstIterator;
+typedef std::vector<EZPlotCurve*>::iterator EZPlotCurveIterator;
+typedef std::vector<EZPlotCurve*>::const_iterator EZPlotCurveConstIterator;
class SGP;
class EZPlot {
private:
- vector<class EZPlotCurve*> m_vecCurves;
+ std::vector<class EZPlotCurve*> m_vecCurves;
// Colors
int clr_axis; // color of all axis lines
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
** 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
{ 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;}
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[];
+/*****************************************************************************\r
+** FILE IDENTIFICATION\r
+**\r
+** Name: fnetorderstream.h\r
+** Purpose: Network-order file stream header\r
+** Programmer: Kevin Rosenberg\r
+** Date Started: Sep 2000\r
+**\r
+** This is part of the CTSim program\r
+** Copyright (C) 1983-2000 Kevin Rosenberg\r
+**\r
+** $Id: fnetorderstream.h,v 1.6 2000/12/16 06:12:47 kevin Exp $\r
+**\r
+** This program is free software; you can redistribute it and/or modify\r
+** it under the terms of the GNU General Public License (version 2) as\r
+** published by the Free Software Foundation.\r
+**\r
+** This program is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+** GNU General Public License for more details.\r
+**\r
+** You should have received a copy of the GNU General Public License\r
+** along with this program; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+******************************************************************************/\r
+\r
+\r
#ifndef NETORDER_H
#define NETORDER_H
#include <fstream>
#include <iostream>
#include <string>
-using namespace std;
inline bool NativeBigEndian (void)
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)
{}
** 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
#include "fnetorderstream.h"
#include "array2dfile.h"
-using namespace std;
-
#ifdef HAVE_MPI
#include <mpi++.h>
#endif
** 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
#include <list>
#include "ctsupport.h"
-using namespace std;
-
typedef enum {
PELEM_INVALID,
PELEM_RECTANGLE,
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
const double xmax() const {return m_xmax;}
const double ymin() const {return m_ymin;}
const double ymax() const {return m_ymax;}
- list<PhantomElement*>& listPElem() {return m_listPElem;}
- const list<PhantomElement*>& listPElem() const {return m_listPElem;}
+ std::list<PhantomElement*>& listPElem() {return m_listPElem;}
+ const std::list<PhantomElement*>& listPElem() const {return m_listPElem;}
const int nPElem() const {return m_nPElem;}
static const int getPhantomCount() {return s_iPhantomCount;}
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<PhantomElement*> m_listPElem; // pelem lists
- string m_name;
+ mutable std::list<PhantomElement*> 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[];
Phantom& operator= (const Phantom&); // assignment operator
};
-typedef list<PhantomElement*>::iterator PElemIterator;
-typedef list<PhantomElement*>::const_iterator PElemConstIterator;
+typedef std::list<PhantomElement*>::iterator PElemIterator;
+typedef std::list<PhantomElement*>::const_iterator PElemConstIterator;
#endif
** 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
#include <complex>
-
class SignalFilter;
class SGP;
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; }
// 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<double> output[], const int n, const int direction);
- static void finiteFourierTransform (const complex<double> input[], complex<double> output[], const int n, const int direction);
- static void finiteFourierTransform (const complex<double> input[], double output[], const int n, const int direction);
+ static void finiteFourierTransform (const double input[], std::complex<double> output[], const int n, const int direction);
+ static void finiteFourierTransform (const std::complex<double> input[], std::complex<double> output[], const int n, const int direction);
+ static void finiteFourierTransform (const std::complex<double> input[], double output[], const int n, const int direction);
static void shuffleNaturalToFourierOrder (double* pdVector, const int n);
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;
double m_dFocalLength;
bool m_fail;
- string m_failMessage;
+ std::string m_failMessage;
static const char* s_aszFilterMethodName[];
static const char* s_aszFilterMethodTitle[];
// transforms that use precalculated trig tables, therefore don't
// require number of data points (n) as an argument
- void finiteFourierTransform (const double input[], complex<double> output[], const int direction) const;
- void finiteFourierTransform (const complex<double> input[], complex<double> output[], const int direction) const;
- void finiteFourierTransform (const complex<double> input[], double output[], const int direction) const;
+ void finiteFourierTransform (const double input[], std::complex<double> output[], const int direction) const;
+ void finiteFourierTransform (const std::complex<double> input[], std::complex<double> output[], const int direction) const;
+ void finiteFourierTransform (const std::complex<double> 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;
** 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
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);
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;}
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;}
{ 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
kuint32 m_hour;
kuint32 m_minute;
kuint32 m_second;
- string m_filename;
+ std::string m_filename;
Array2dFileLabel m_label;
const static kuint16 m_signature;
** 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
~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);
int m_iTrace;
bool m_bFail;
- string m_strFailMessage;
+ std::string m_strFailMessage;
double* m_adPlotXAxis;
};
** 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
#endif
#include <string>
-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
int getPhysicalYSize () const
{ return m_iPhysicalYSize; }
- const string& getWindowTitle () const
+ const std::string& getWindowTitle () const
{ return m_sWindowTitle; }
bool isWX () const
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);
** 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
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];
** 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
void
-SGP::drawText (const string& rsMessage)
+SGP::drawText (const std::string& rsMessage)
{
drawText (rsMessage.c_str());
}
** 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
typedef long off_t;\r
#endif
-using namespace std;
const kuint16 Array2dFile::m_signature = ('I'*256+'F');
second = m_second;
}
-const string&
+const std::string&
Array2dFileLabel::getDateString (void) const
{
char szDate [128];\r
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;
}
}
}
bool
-Array2dFile::fileWrite (const string& filename)
+Array2dFile::fileWrite (const std::string& filename)
{
return fileWrite (filename.c_str());
}
{
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;
}
bool
-Array2dFile::fileRead (const string& filename)
+Array2dFile::fileRead (const std::string& filename)
{
return fileRead (filename.c_str());
}
m_filename = filename;
#ifdef MSVC\r
- frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary);\r
+ frnetorderstream fs (m_filename.c_str(), std::ios::out | std::ios::in | std::ios::binary);\r
#else\r
- frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary | ios::nocreate);\r
+ frnetorderstream fs (m_filename.c_str(), std::ios::out | std::ios::in | std::ios::binary | std::ios::nocreate);\r
#endif\r
if (fs.fail()) {
sys_error (ERR_WARNING, "Unable to open file %s [fileRead]", m_filename.c_str());
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);
}
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;
}
}
** 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
void Backproject::errorIndexOutsideDetector (int ix, int iy, double theta, double L, int iDetPos)
{\r
#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";
** 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
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;
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;
}
mode = (max_binindex * spread / (nbin - 1)) + min;
int nPixels = nx * ny;
- list<double> vecImage;
+ std::list<double> vecImage;
for (int ix5 = 0; ix5 < nx; ix5++)
for (int iy = 0; iy < ny; iy++)
vecImage.push_front (v[ix5][iy]);
vecImage.sort();
- list<double>::const_iterator iter = vecImage.begin();
+ std::list<double>::const_iterator iter = vecImage.begin();
for (int i = 0; i < (nPixels / 2) - 1; i++)
iter++; // Advance iterator to (nPixels / 2) - 1;
** 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
show (sgp);
- cout << "Press return to continue";
+ std::cout << "Press return to continue";
cio_kb_getc();
}
** 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
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;
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];\r
SignalFilter filter (m_idFilter, m_dFilterMin, m_dFilterMax, nSpatialPoints, m_dBandwidth, m_dFilterParam, SignalFilter::DOMAIN_SPATIAL);
adSpatialFilter[i] = 0;
m_adFilter = new double [m_nFilterPoints];
- complex<double>* acInverseFilter = new complex<double> [m_nFilterPoints];\r
+ std::complex<double>* acInverseFilter = new std::complex<double> [m_nFilterPoints];\r
finiteFourierTransform (adSpatialFilter, acInverseFilter, m_nFilterPoints, 1);
delete adSpatialFilter;\r
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;\r
#ifdef HAVE_SGP
if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
inputSignal[i] = input[i];
for (i = m_nSignalPoints; i < m_nFilterPoints; i++)
inputSignal[i] = 0; // zeropad
- complex<double>* fftSignal = new complex<double> [m_nFilterPoints];
+ std::complex<double>* fftSignal = new std::complex<double> [m_nFilterPoints];
finiteFourierTransform (inputSignal, fftSignal, m_nFilterPoints, -1);\r
delete inputSignal;
for (i = 0; i < m_nFilterPoints; i++)
inputSignal[i] = input[i];
for (i = m_nSignalPoints; i < m_nFilterPoints; i++)
inputSignal[i] = 0; // zeropad
- complex<double>* fftSignal = new complex<double> [m_nFilterPoints];
+ std::complex<double>* fftSignal = new std::complex<double> [m_nFilterPoints];
finiteFourierTransform (inputSignal, fftSignal, -1);\r
delete inputSignal;
for (i = 0; i < m_nFilterPoints; i++)
void
ProcessSignal::finiteFourierTransform (const double input[], double output[], const int n, int direction)
{
- complex<double>* complexOutput = new complex<double> [n];
+ std::complex<double>* complexOutput = new std::complex<double> [n];
finiteFourierTransform (input, complexOutput, n, direction);
for (int i = 0; i < n; i++)
}
void
-ProcessSignal::finiteFourierTransform (const double input[], complex<double> output[], const int n, int direction)
+ProcessSignal::finiteFourierTransform (const double input[], std::complex<double> output[], const int n, int direction)
{
if (direction < 0)
direction = -1;
sumReal /= n;
sumImag /= n;
}
- output[i] = complex<double> (sumReal, sumImag);
+ output[i] = std::complex<double> (sumReal, sumImag);
}
}
void
-ProcessSignal::finiteFourierTransform (const complex<double> input[], complex<double> output[], const int n, int direction)
+ProcessSignal::finiteFourierTransform (const std::complex<double> input[], std::complex<double> output[], const int n, int direction)
{
if (direction < 0)
direction = -1;
double angleIncrement = direction * 2 * PI / n;
for (int i = 0; i < n; i++) {
- complex<double> sum (0,0);
+ std::complex<double> sum (0,0);
for (int j = 0; j < n; j++) {
double angle = i * j * angleIncrement;
- complex<double> exponentTerm (cos(angle), sin(angle));
+ std::complex<double> exponentTerm (cos(angle), sin(angle));
sum += input[j] * exponentTerm;
}
if (direction < 0) {
}
void
-ProcessSignal::finiteFourierTransform (const complex<double> input[], double output[], const int n, int direction)
+ProcessSignal::finiteFourierTransform (const std::complex<double> input[], double output[], const int n, int direction)
{
if (direction < 0)
direction = -1;
// Table-based routines
void
-ProcessSignal::finiteFourierTransform (const double input[], complex<double> output[], int direction) const
+ProcessSignal::finiteFourierTransform (const double input[], std::complex<double> output[], int direction) const
{
if (direction < 0)
direction = -1;
sumReal /= m_nFilterPoints;
sumImag /= m_nFilterPoints;
}
- output[i] = complex<double> (sumReal, sumImag);
+ output[i] = std::complex<double> (sumReal, sumImag);
}
}
// (a+bi) * (c + di) = (ac - bd) + (ad + bc)i
void
-ProcessSignal::finiteFourierTransform (const complex<double> input[], complex<double> output[], int direction) const
+ProcessSignal::finiteFourierTransform (const std::complex<double> input[], std::complex<double> output[], int direction) const
{
if (direction < 0)
direction = -1;
sumReal /= m_nFilterPoints;
sumImag /= m_nFilterPoints;
}
- output[i] = complex<double> (sumReal, sumImag);
+ output[i] = std::complex<double> (sumReal, sumImag);
}
}
void
-ProcessSignal::finiteFourierTransform (const complex<double> input[], double output[], int direction) const
+ProcessSignal::finiteFourierTransform (const std::complex<double> input[], double output[], int direction) const
{
if (direction < 0)
direction = -1;
** 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
#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
}
}
bool
-Projections::read (const string& filename)
+Projections::read (const std::string& filename)
{
return read (filename.c_str());
}
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;
}
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);
}
bool
-Projections::write (const string& filename)
+Projections::write (const std::string& filename)
{
return write (filename.c_str());
}
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);
}
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";
** 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
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();
** 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
traceShowParam ("Current View:", "%d (%.0f%%)", PROJECTION_TRACE_ROW_CURR_VIEW, C_RED, iView + iStartView, (iView + iStartView) / static_cast<double>(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);
// Work around bug in VC6
#ifdef MSVC
-const struct fpos_t std::_Fpz = {0, 0};
+const fpos_t std::_Fpz = 0;
#endif
\r
** 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
** 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"
+\r
+\r
+// For compilers that support precompilation, includes "wx/wx.h".\r
+#include "wx/wxprec.h"\r
+\r
+#ifdef __BORLANDC__\r
+#pragma hdrstop\r
+#endif\r
+\r
+#ifndef WX_PRECOMP\r
+#include "wx/wx.h"\r
+#endif\r
+\r
+#if !wxUSE_DOC_VIEW_ARCHITECTURE\r
+#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!\r
+#endif\r
+\r
+#include "ct.h"\r
#include "ctsim.h"
#include "docs.h"
#include "views.h"
#include "dialogs.h"
-#include "ctsupport.h"
+\r
#if defined(HAVE_CONFIG_H)
#include "config.h"
-#endif
+#endif\r
+\r
#if defined(HAVE_GETOPT_H) || defined(HAVE_GETOPT_LONG)
#ifdef MSVC\r
#define __STDC__ 1\r
+#endif\r
#include "getopt.h"\r
+#ifdef MSVC\r
#undef __STDC__\r
#endif
#endif
-
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.15 2000/12/16 03:39:06 kevin Exp $";
+\r
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.16 2000/12/16 06:12:47 kevin Exp $";
class CTSimApp* theApp = NULL;
** 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
#ifndef __CTSIMH__
#define __CTSIMH__
-#include "wx/docview.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
class wxMenu;
class wxDocument;
+#include "wx/docview.h"\r
// Define a new frame for main window
class MainFrame: public wxDocParentFrame
** 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
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);
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);
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);
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);
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);
** 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
#include "docs.h"
#include "views.h"
-
// ImageFileDocument
IMPLEMENT_DYNAMIC_CLASS(ImageFileDocument, wxDocument)
** 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
** 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"
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
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: "<<min<<"\nmax: "<<max<<"\nmean: "<<mean<<"\nmode: "<<mode<<"\nstddev: "<<stddev << "\n";
*theApp->getLog() << os.str().c_str();
wxMessageDialog dialogMsg (m_frame, os.str().c_str(), "Imagefile Properties", wxOK | wxICON_INFORMATION);
{
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
}
}
- 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();
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();
}
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);
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());
** 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
{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 $";
+\r
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;
}
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;
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:
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
if (bOptVerbose) {
ostringstream os;
projGlobal.printScanInfo (os);
- cout << os.str();
+ std::cout << os.str();
}
mpi_ndet = projGlobal.nDet();
#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);
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();
#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();
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();
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);