r246: More modifications for MSVC
authorKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 6 Dec 2000 01:46:43 +0000 (01:46 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 6 Dec 2000 01:46:43 +0000 (01:46 +0000)
20 files changed:
include/backprojectors.h
include/ctsupport.h
include/ezplot.h
include/phantom.h
include/sgp.h
include/transformmatrix.h
libctgraphics/ezplot.cpp
libctgraphics/ezset.cpp
libctgraphics/sgp.cpp
libctgraphics/transformmatrix.cpp
libctsim/array2dfile.cpp
libctsim/backprojectors.cpp
libctsim/imagefile.cpp
libctsim/phantom.cpp
libctsim/procsignal.cpp
libctsim/projections.cpp
libctsim/reconstruct.cpp
libctsim/scanner.cpp
libctsupport/clip.cpp
libctsupport/syserror.cpp

index e3418dfe192d783c165d4db6be4b8ec2c20a8939..c3196f67f8d32fb5967ecc811e44823f710bfb5b 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: backprojectors.h,v 1.16 2000/12/03 15:16:17 kevin Exp $
+**  $Id: backprojectors.h,v 1.17 2000/12/06 01:46:43 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
 **
 **  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
@@ -144,10 +144,10 @@ class BackprojectTrig : public Backproject
 {
  public:
   BackprojectTrig (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
 {
  public:
   BackprojectTrig (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
-      : Backproject::Backproject (proj, im, interpID, interpFactor)
+      : Backproject (proj, im, interpID, interpFactor)
       {}
 
       {}
 
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 };
 
 
 };
 
 
@@ -157,7 +157,7 @@ class BackprojectTable : public Backproject
   BackprojectTable (const Projections& proj, ImageFile& im, int interpID, const int interpFactor);
   virtual ~BackprojectTable ();
 
   BackprojectTable (const Projections& proj, ImageFile& im, int interpID, const int interpFactor);
   virtual ~BackprojectTable ();
 
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 
  protected:
   Array2d<kfloat64> arrayR;
 
  protected:
   Array2d<kfloat64> arrayR;
@@ -173,7 +173,7 @@ class BackprojectDiff : public Backproject
   BackprojectDiff (const Projections& proj, ImageFile& im, int interpID, const int interpFactor);
   ~BackprojectDiff ();
 
   BackprojectDiff (const Projections& proj, ImageFile& im, int interpID, const int interpFactor);
   ~BackprojectDiff ();
 
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 
  protected:
   double start_r;
 
  protected:
   double start_r;
@@ -185,20 +185,20 @@ class BackprojectDiff2 : public BackprojectDiff
 {
  public:
   BackprojectDiff2 (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
 {
  public:
   BackprojectDiff2 (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
-    :  BackprojectDiff::BackprojectDiff (proj, im, interpID, interpFactor)
+    :  BackprojectDiff (proj, im, interpID, interpFactor)
     {}
 
     {}
 
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 };
 
 class BackprojectIntDiff2 : public BackprojectDiff
 {
  public:
   BackprojectIntDiff2 (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
 };
 
 class BackprojectIntDiff2 : public BackprojectDiff
 {
  public:
   BackprojectIntDiff2 (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
-    :  BackprojectDiff::BackprojectDiff (proj, im, interpID, interpFactor)
+    :  BackprojectDiff (proj, im, interpID, interpFactor)
     {}
   
     {}
   
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 };
 
 
 };
 
 
@@ -206,20 +206,20 @@ class BackprojectIntDiff3 : public BackprojectDiff
 {
  public:
   BackprojectIntDiff3 (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
 {
  public:
   BackprojectIntDiff3 (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
-    :  BackprojectDiff::BackprojectDiff (proj, im, interpID, interpFactor)
+    :  BackprojectDiff (proj, im, interpID, interpFactor)
     {}
   
     {}
   
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 };
 
 class BackprojectEquilinear : public BackprojectTable
 {
  public:
   BackprojectEquilinear (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
 };
 
 class BackprojectEquilinear : public BackprojectTable
 {
  public:
   BackprojectEquilinear (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
-      : BackprojectTable::BackprojectTable (proj, im, interpID, interpFactor)
+      : BackprojectTable (proj, im, interpID, interpFactor)
       {}
 
       {}
 
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 
   virtual ~BackprojectEquilinear()
       {}
 
   virtual ~BackprojectEquilinear()
       {}
@@ -229,10 +229,10 @@ class BackprojectEquiangular : public BackprojectTable
 {
  public:
   BackprojectEquiangular (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
 {
  public:
   BackprojectEquiangular (const Projections& proj, ImageFile& im, int interpID, const int interpFactor)
-      : BackprojectTable::BackprojectTable (proj, im, interpID, interpFactor)
+      : BackprojectTable (proj, im, interpID, interpFactor)
       {}
 
       {}
 
-  void BackprojectView (const double* const t, double view_angle);
+  void BackprojectView (const double* const t, const double view_angle);
 
   virtual ~BackprojectEquiangular()
       {}
 
   virtual ~BackprojectEquiangular()
       {}
index 14ef13c2b87edb1d844db171b504aca0093903e4..60a6c2c40adb2fd6acc476895b2aae76e6b48abb 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ctsupport.h,v 1.7 2000/11/28 14:54:07 kevin Exp $
+**  $Id: ctsupport.h,v 1.8 2000/12/06 01:46:43 kevin Exp $
 **
 **
 **  This program is free software; you can redistribute it and/or modify
 **
 **
 **  This program is free software; you can redistribute it and/or modify
@@ -222,6 +222,9 @@ template<class T>
 inline T nearest (double x)
 { return (x > 0 ? static_cast<T>(x+0.5) : static_cast<T>(x-0.5)); }
 
 inline T nearest (double x)
 { return (x > 0 ? static_cast<T>(x+0.5) : static_cast<T>(x-0.5)); }
 
+inline int imax (int a, int b)\r
+{ return (a >= b ? a : b); }\r
+\r
 template<class T>
 inline T clamp (T value, T lowerBounds, T upperBounds)
 { return (value >= upperBounds ? upperBounds : (value <= lowerBounds ? lowerBounds : value )); }
 template<class T>
 inline T clamp (T value, T lowerBounds, T upperBounds)
 { return (value >= upperBounds ? upperBounds : (value <= lowerBounds ? lowerBounds : value )); }
@@ -248,7 +251,7 @@ inline void minmax_array (const T* array, const int n, T& min, T& max)
 //////////////////////////////////////////////////////////////
 
 // clip.cpp 
 //////////////////////////////////////////////////////////////
 
 // clip.cpp 
-int clip_rect (double& x1, double& y1, double& x2, double& y2, const double rect[4]);
+bool clip_rect (double& x1, double& y1, double& x2, double& y2, const double rect[4]);
 int clip_segment (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
 int clip_sector (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
 int clip_circle (double& x1, double& y1, double& x2, double& y2, const double cx, const double cy, const double radius, double t1, double t2);
 int clip_segment (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
 int clip_sector (double& x1, double& y1, double& x2, double& y2, const double u, const double v);
 int clip_circle (double& x1, double& y1, double& x2, double& y2, const double cx, const double cy, const double radius, double t1, double t2);
index 72153bffaa75b6fbaedef8735e2fe7cf0256569b..11f95ba4f4bebdec4343b2d8b372d6d57be150bf 100644 (file)
@@ -7,7 +7,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ezplot.h,v 1.15 2000/11/28 14:54:07 kevin Exp $
+**  $Id: ezplot.h,v 1.16 2000/12/06 01:46:43 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
 **
 **  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
@@ -139,7 +139,7 @@ class EZPlot {
     string c_legend;;  // current legend specified 
     
     int o_linestyle, o_color;  // style to use for curves all subsequent curves to EZPLOT 
     string c_legend;;  // current legend specified 
     
     int o_linestyle, o_color;  // style to use for curves all subsequent curves to EZPLOT 
-    bool o_xaxis, o_yaxis;             // Specifies where axis & labels are drawn 
+    int o_xaxis, o_yaxis;              // Specifies where axis & labels are drawn 
     bool o_grid;                       // Flag to draw a grid at major ticks 
     bool o_box;                        // Flag to draw a box around the graph 
     
     bool o_grid;                       // Flag to draw a grid at major ticks 
     bool o_box;                        // Flag to draw a box around the graph 
     
index bc245ee7512e7a5477e875399ba8574aa712c955..651e1ebd8a3a1275648edee15eaf6b05186a49a5 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: phantom.h,v 1.15 2000/12/04 05:36:57 kevin Exp $
+**  $Id: phantom.h,v 1.16 2000/12/06 01:46:43 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
 **
 **  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,9 +28,7 @@
 #ifndef PHANTOM_H
 #define PHANTOM_H
 
 #ifndef PHANTOM_H
 #define PHANTOM_H
 
-#ifndef MSVC\r
-#include <slist>
-#endif\r
+#include <list>
 #include "ctsupport.h"
 
 using namespace std;
 #include "ctsupport.h"
 
 using namespace std;
@@ -191,8 +189,8 @@ class Phantom
     const double xmax() const {return m_xmax;}
     const double ymin() const {return m_ymin;}
     const double ymax() const {return m_ymax;}
     const double xmax() const {return m_xmax;}
     const double ymin() const {return m_ymin;}
     const double ymax() const {return m_ymax;}
-    slist<PhantomElement*>& listPElem() {return m_listPElem;}
-    const slist<PhantomElement*>& listPElem() const {return m_listPElem;}
+    list<PhantomElement*>& listPElem() {return m_listPElem;}
+    const list<PhantomElement*>& listPElem() const {return m_listPElem;}
     const int nPElem() const {return m_nPElem;}
 
     static const int getPhantomCount() {return s_iPhantomCount;}
     const int nPElem() const {return m_nPElem;}
 
     static const int getPhantomCount() {return s_iPhantomCount;}
@@ -207,7 +205,7 @@ 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
     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 slist<PhantomElement*> m_listPElem;      // pelem lists
+    mutable list<PhantomElement*> m_listPElem;      // pelem lists
     string m_name;
     int m_id;
     bool m_fail;
     string m_name;
     int m_id;
     bool m_fail;
@@ -223,7 +221,7 @@ class Phantom
     Phantom& operator= (const Phantom&); // assignment operator
 };
 
     Phantom& operator= (const Phantom&); // assignment operator
 };
 
-typedef slist<PhantomElement*>::iterator PElemIterator;
-typedef slist<PhantomElement*>::const_iterator PElemConstIterator;
+typedef list<PhantomElement*>::iterator PElemIterator;
+typedef list<PhantomElement*>::const_iterator PElemConstIterator;
 
 #endif
 
 #endif
index 4ee4638d346d84eda52d492c17fabe1418a8828c..f30f582e3df2762114744de2b698a86ca596c29d 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: sgp.h,v 1.19 2000/12/04 04:15:48 kevin Exp $
+**  $Id: sgp.h,v 1.20 2000/12/06 01:46:43 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
 **
 **  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,7 +47,7 @@ extern "C" {
 #endif
 
 #include <string>
 #endif
 
 #include <string>
-
+using namespace std;
 
 class SGPDriver {
 private:
 
 class SGPDriver {
 private:
index 5274b309a80fa09c9f65b33935a5c27951c8744f..6282b6172babce9f88b0c131c469e449491b3151 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: transformmatrix.h,v 1.1 2000/07/28 08:28:08 kevin Exp $
+**  $Id: transformmatrix.h,v 1.2 2000/12/06 01:46:43 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
 **
 **  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,8 @@
 #ifndef __H_TRANSFORMMATRIX
 #define __H_TRANSFORMMATRIX
 
 #ifndef __H_TRANSFORMMATRIX
 #define __H_TRANSFORMMATRIX
 
-class ostream;
+#include <ostream>\r
+
 class TransformationMatrix2D {
 public:
   double mtx[3][3];
 class TransformationMatrix2D {
 public:
   double mtx[3][3];
@@ -48,7 +49,7 @@ public:
 
   void transformPoint (double *pX, double *pY) const;
 
 
   void transformPoint (double *pX, double *pY) const;
 
-  void print (ostream& ostr) const;
+  void print (std::ostream& ostr) const;
 
   friend const TransformationMatrix2D operator* (const TransformationMatrix2D& lhs, const TransformationMatrix2D& rhs);
 
 
   friend const TransformationMatrix2D operator* (const TransformationMatrix2D& lhs, const TransformationMatrix2D& rhs);
 
index 965ef102ed7d32052b6b03f7d10c1da768bea019..8d7b516bb3dd495c98932cebdbe99437f39e4881 100644 (file)
@@ -6,7 +6,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ezplot.cpp,v 1.15 2000/09/09 09:31:12 kevin Exp $
+**  $Id: ezplot.cpp,v 1.16 2000/12/06 01:46:43 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
 **
 **  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
@@ -64,47 +64,52 @@ EZPlotCurve::~EZPlotCurve ()
 void 
 EZPlot::addCurve (const double *y, int n)
 {
 void 
 EZPlot::addCurve (const double *y, int n)
 {
-  double x [n];
+  double* x = new double [n];
 
   for (int i = 0; i < n; i++)
     x[i] = i;
 
   addCurve (x, y, n);
 
   for (int i = 0; i < n; i++)
     x[i] = i;
 
   addCurve (x, y, n);
+  delete x;
 }
 
 
 void 
 EZPlot::addCurve (const float *y, int n)
 {
 }
 
 
 void 
 EZPlot::addCurve (const float *y, int n)
 {
-  double yDouble [n];
+  double* yDouble = new double [n];
 
   for (int i = 0; i < n; i++)
     yDouble[i] = y[i];
 
   addCurve (yDouble, n);
 
   for (int i = 0; i < n; i++)
     yDouble[i] = y[i];
 
   addCurve (yDouble, n);
+  delete yDouble;
 }
 
 
 void
 EZPlot::addCurve (const float x[], const double y[], int num)
 {
 }
 
 
 void
 EZPlot::addCurve (const float x[], const double y[], int num)
 {
-  double dx [num];
+  double* dx = new double [num];
 
   for (int i = 0; i < num; i++)
     dx[i] = x[i];
 
   addCurve (dx, y, num);
 
   for (int i = 0; i < num; i++)
     dx[i] = x[i];
 
   addCurve (dx, y, num);
+  delete dx;
 }
 
 void
 EZPlot::addCurve (const double x[], const float y[], int num)
 {
 }
 
 void
 EZPlot::addCurve (const double x[], const float y[], int num)
 {
-  double dy [num];
+  double* dy = new double [num];
 
   for (int i = 0; i < num; i++)
     dy[i] = y[i];
 
   addCurve (x, dy, num);
 
   for (int i = 0; i < num; i++)
     dy[i] = y[i];
 
   addCurve (x, dy, num);
+
+  delete dy;
 }
 
 
 }
 
 
@@ -338,12 +343,13 @@ EZPlot::plot ()
   // calculate legend box boundaries 
   int max_leg = 0;                     // longest legend in characters 
   int num_leg = 0;                     // number of legend titles 
   // calculate legend box boundaries 
   int max_leg = 0;                     // longest legend in characters 
   int num_leg = 0;                     // number of legend titles 
-  for (EZPlotCurveConstIterator iterCurve = m_vecCurves.begin(); iterCurve != m_vecCurves.end(); iterCurve++) {
-    const EZPlotCurve& curve = **iterCurve;
+  for (EZPlotCurveConstIterator iterCurve2 = m_vecCurves.begin(); iterCurve2 != m_vecCurves.end(); iterCurve2++) {
+    const EZPlotCurve& curve = **iterCurve2;
     int nLegend = curve.m_sLegend.length();
     if (nLegend > 0) {
       ++num_leg;
     int nLegend = curve.m_sLegend.length();
     if (nLegend > 0) {
       ++num_leg;
-      max_leg = max (max_leg, nLegend);
+      if (nLegend > max_leg)\r
+               nLegend = max_leg;
     }
   }
 
     }
   }
 
@@ -521,8 +527,8 @@ EZPlot::plot ()
   double symwidth = charwidth;
   double symheight = charheight;
   
   double symwidth = charwidth;
   double symheight = charheight;
   
-  for (EZPlotCurveIterator iterCurve = m_vecCurves.begin(); iterCurve != m_vecCurves.end(); iterCurve++) {
-      const EZPlotCurve& curve = **iterCurve;
+  for (EZPlotCurveIterator iterCurve3 = m_vecCurves.begin(); iterCurve3 != m_vecCurves.end(); iterCurve3++) {
+      const EZPlotCurve& curve = **iterCurve3;
 
       rSGP.setColor (curve.m_iColor);
 
 
       rSGP.setColor (curve.m_iColor);
 
@@ -908,8 +914,10 @@ EZPlot::make_numfmt (char *fmtstr, int *fldwid, int *nfrac, double minval, doubl
 
   double delta = (maxval - minval) / nint;
   double absmin = fabs(minval);
 
   double delta = (maxval - minval) / nint;
   double absmin = fabs(minval);
-  double absmax = fabs(maxval);
-  double logt = log10( max(absmin, absmax) );
+  double absmax = fabs(maxval);\r
+  if (absmin > absmax)\r
+       absmax = absmin;
+  double logt = log10( absmax );
 
   if (fabs(logt) >= 6) {               // use exponential format 
     if (fabs(logt) > 99)
 
   if (fabs(logt) >= 6) {               // use exponential format 
     if (fabs(logt) > 99)
index 074b287025608cab5d454a67696cfc694ea18ec9..e4f6abfee43a4fd7586cffd5f086501ce4301c78 100644 (file)
@@ -6,7 +6,7 @@
  **  This is part of the CTSim program
  **  Copyright (C) 1983-2000 Kevin Rosenberg
  **
  **  This is part of the CTSim program
  **  Copyright (C) 1983-2000 Kevin Rosenberg
  **
- **  $Id: ezset.cpp,v 1.7 2000/07/29 19:50:08 kevin Exp $
+ **  $Id: ezset.cpp,v 1.8 2000/12/06 01:46:43 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
  **
  **  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
@@ -62,7 +62,7 @@ EZPlot::ezcmd (char *comm)
   int code;
   bool retval = true;
   if (! pol_usertok (str, &code)) {
   int code;
   bool retval = true;
   if (! pol_usertok (str, &code)) {
-    cerr << "Illegal EZSET command: " << str << endl;
+       sys_error(ERR_WARNING, "Illegal EZSET command: %s", str);
     pol_reader();
     retval = false;
   }
     pol_reader();
     retval = false;
   }
@@ -376,7 +376,7 @@ EZPlot::do_cmd (int lx)
 void 
 EZPlot::bad_option (char *opt)
 {
 void 
 EZPlot::bad_option (char *opt)
 {
-  cerr << opt << " is an INVALID option\n";
+  sys_error (ERR_WARNING, "INVALID option: %s", opt);
 }
 
 /*----------------------------------------------------------------------*/
 }
 
 /*----------------------------------------------------------------------*/
index 07e103f182e054d3f20fbd74c1cf83de54169e1c..3626555c86f0e67d0fc0aad46a503a8326324fae 100644 (file)
@@ -7,7 +7,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: sgp.cpp,v 1.16 2000/10/11 08:16:08 kevin Exp $
+**  $Id: sgp.cpp,v 1.17 2000/12/06 01:46:43 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
 **
 **  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,14 +52,14 @@ RGBColor SGP::s_aRGBColor[] =
 int SGP::s_iRGBColorCount = sizeof(s_aRGBColor) / sizeof(class RGBColor);
 
 #ifdef HAVE_WXWINDOWS
 int SGP::s_iRGBColorCount = sizeof(s_aRGBColor) / sizeof(class RGBColor);
 
 #ifdef HAVE_WXWINDOWS
-SGPDriver::SGPDriver (wxDC* pDC, int xsize = 640, int ysize = 480)
+SGPDriver::SGPDriver (wxDC* pDC, int xsize, int ysize)
   : m_iPhysicalXSize(xsize), m_iPhysicalYSize(ysize), m_idDriver(0), m_pDC(pDC)
 {
   m_idDriver |= SGPDRIVER_WXWINDOWS;
 }
 #endif
 
   : m_iPhysicalXSize(xsize), m_iPhysicalYSize(ysize), m_idDriver(0), m_pDC(pDC)
 {
   m_idDriver |= SGPDRIVER_WXWINDOWS;
 }
 #endif
 
-SGPDriver::SGPDriver (const char* szWinTitle = "", int xsize = 640, int ysize = 480)
+SGPDriver::SGPDriver (const char* szWinTitle, int xsize, int ysize)
   : m_iPhysicalXSize(xsize), m_iPhysicalYSize(ysize), m_sWindowTitle(szWinTitle), m_idDriver(0)
 {
 #ifdef HAVE_G2_H
   : m_iPhysicalXSize(xsize), m_iPhysicalYSize(ysize), m_sWindowTitle(szWinTitle), m_idDriver(0)
 {
 #ifdef HAVE_G2_H
index 7e3c73d91b2500f0e95e65016e45e0bfa9f6abbb..9edf3aaf65623ea2fab61cfe2ba5adad85e4ef05 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: transformmatrix.cpp,v 1.2 2000/12/04 04:44:02 kevin Exp $
+**  $Id: transformmatrix.cpp,v 1.3 2000/12/06 01:46:43 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
 **
 **  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
@@ -93,8 +93,8 @@ TransformationMatrix2D::invert () const
   double determ = determinant ();
   if (fabs(determ) < 1E-6) {
     sys_error (ERR_WARNING, "Determinant = %g [TransformationMatrix2D::invert]", determ);\r
   double determ = determinant ();
   if (fabs(determ) < 1E-6) {
     sys_error (ERR_WARNING, "Determinant = %g [TransformationMatrix2D::invert]", determ);\r
-       print (cout);\r
-       cout << endl;
+       print (std::cout);\r
+       std::cout << std::endl;
   }
 
   b[0][0] =  (mtx[1][1] * mtx[2][2] - mtx[2][1] * mtx[1][2]) / determ;
   }
 
   b[0][0] =  (mtx[1][1] * mtx[2][2] - mtx[2][1] * mtx[1][2]) / determ;
@@ -134,11 +134,11 @@ TransformationMatrix2D::transformPoint (double* pX, double *pY) const
 }
 
 void
 }
 
 void
-TransformationMatrix2D::print (ostream& ostr) const
+TransformationMatrix2D::print (std::ostream& ostr) const
 {
 {
-    cout << mtx[0][0] << " " << mtx[0][1] << " " << mtx[0][2] << endl;
-    cout << mtx[1][0] << " " << mtx[1][1] << " " << mtx[1][2] << endl;
-    cout << mtx[2][0] << " " << mtx[2][1] << " " << mtx[2][2] << endl;
+       std::cout << mtx[0][0] << " " << mtx[0][1] << " " << mtx[0][2] << std::endl;
+       std::cout << mtx[1][0] << " " << mtx[1][1] << " " << mtx[1][2] << std::endl;
+       std::cout << mtx[2][0] << " " << mtx[2][1] << " " << mtx[2][2] << std::endl;
 }
 
 
 }
 
 
index 2999470e871e85af572312a63f941e796ab9ae0a..b16c7d3b7810db59fd734e8cca62c24fe73e1201 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: array2dfile.cpp,v 1.14 2000/12/04 19:50:57 kevin Exp $
+**  $Id: array2dfile.cpp,v 1.15 2000/12/06 01:46:43 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
 **
 **  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
@@ -392,7 +392,7 @@ Array2dFile::headerWrite (frnetorderstream& fs)
   fs.writeFloat64 (m_offsetPV);
   fs.writeFloat64 (m_scalePV);
 
   fs.writeFloat64 (m_offsetPV);
   fs.writeFloat64 (m_scalePV);
 
-  m_headersize = fs.tellp();
+  m_headersize = static_cast<kuint16>(fs.tellp());
   fs.seekp (0);
   fs.writeInt16 (m_headersize);
   
   fs.seekp (0);
   fs.writeInt16 (m_headersize);
   
@@ -480,12 +480,12 @@ Array2dFile::labelsRead (frnetorderstream& fs)
        
        kuint16 strLength;
        fs.readInt16 (strLength);
        
        kuint16 strLength;
        fs.readInt16 (strLength);
-       char* labelStr = new char [strLength+1];
-       fs.read (labelStr, strLength);
-       labelStr[strLength] = 0;
+       char* pszLabelStr = new char [strLength+1];
+       fs.read (pszLabelStr, strLength);
+       pszLabelStr[strLength] = 0;
 
 
-       Array2dFileLabel* pLabel = new Array2dFileLabel(labelType, labelStr, calcTime);
-       delete labelStr;\r
+       Array2dFileLabel* pLabel = new Array2dFileLabel (labelType, pszLabelStr, calcTime);
+       delete pszLabelStr;\r
 \r
        pLabel->setDateTime (year, month, day, hour, minute, second);
        m_labels.push_back (pLabel);\r
 \r
        pLabel->setDateTime (year, month, day, hour, minute, second);
        m_labels.push_back (pLabel);\r
index 5f674ec48b9a287345d5d2adfbca537ee6bdc975..ecdc3fdcf753bbe9c41dbc620b170500c375bf16 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: backprojectors.cpp,v 1.16 2000/12/04 19:50:57 kevin Exp $
+**  $Id: backprojectors.cpp,v 1.17 2000/12/06 01:46:43 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
 **
 **  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
@@ -359,7 +359,7 @@ BackprojectTrig::BackprojectView (const double* const filteredProj, const double
 //   Precalculates trigometric function value for each point in image for backprojection.
 
 BackprojectTable::BackprojectTable (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
 //   Precalculates trigometric function value for each point in image for backprojection.
 
 BackprojectTable::BackprojectTable (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
-  : Backproject::Backproject (proj, im, interpType, interpFactor)
+  : Backproject (proj, im, interpType, interpFactor)
 {
   arrayR.initSetSize (im.nx(), im.ny());
   arrayPhi.initSetSize (im.nx(), im.ny());
 {
   arrayR.initSetSize (im.nx(), im.ny());
   arrayPhi.initSetSize (im.nx(), im.ny());
@@ -421,7 +421,7 @@ BackprojectTable::BackprojectView (const double* const filteredProj, const doubl
 //   Iterates in x & y direction by adding difference in L position
 
 BackprojectDiff::BackprojectDiff (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
 //   Iterates in x & y direction by adding difference in L position
 
 BackprojectDiff::BackprojectDiff (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
-  :  Backproject::Backproject (proj, im, interpType, interpFactor)
+  :  Backproject (proj, im, interpType, interpFactor)
 {
   // calculate center of first pixel v[0][0] 
   double x = xMin + xInc / 2;
 {
   // calculate center of first pixel v[0][0] 
   double x = xMin + xInc / 2;
index 96577555ac68a27ea21503f3c6c6eeda23a48059..803347f2e76f071c8fd1ae6b110ac04a84b61994 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: imagefile.cpp,v 1.16 2000/12/04 05:36:57 kevin Exp $
+**  $Id: imagefile.cpp,v 1.17 2000/12/06 01:46:43 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
 **
 **  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
 
 
 F32Image::F32Image (int nx, int ny)\r
 
 
 F32Image::F32Image (int nx, int ny)\r
-      : Array2dFile::Array2dFile (nx, ny, sizeof(kfloat32), Array2dFile::PIXEL_FLOAT32)\r
+      : Array2dFile (nx, ny, sizeof(kfloat32), Array2dFile::PIXEL_FLOAT32)\r
   {\r
   }\r
 \r
   {\r
   }\r
 \r
-F32Image::F32Image (void)[\r
-      : Array2dFile::Array2dFile()\r
+F32Image::F32Image (void)\r
+      : Array2dFile()\r
   {\r
       setPixelFormat (Array2dFile::PIXEL_FLOAT32);\r
       setPixelSize (sizeof(kfloat32));\r
   }\r
 \r
 F64Image::F64Image (int nx, int ny)\r
   {\r
       setPixelFormat (Array2dFile::PIXEL_FLOAT32);\r
       setPixelSize (sizeof(kfloat32));\r
   }\r
 \r
 F64Image::F64Image (int nx, int ny)\r
-      : Array2dFile::Array2dFile (nx, ny, sizeof(kfloat64), Array2dFile::PIXEL_FLOAT64)\r
+      : Array2dFile (nx, ny, sizeof(kfloat64), Array2dFile::PIXEL_FLOAT64)\r
   {\r
   }\r
 \r
 F64Image::F64Image (void)\r
   {\r
   }\r
 \r
 F64Image::F64Image (void)\r
-      : Array2dFile::Array2dFile ()\r
+      : Array2dFile ()\r
   {\r
       setPixelFormat (PIXEL_FLOAT64);\r
       setPixelSize (sizeof(kfloat64));\r
   {\r
       setPixelFormat (PIXEL_FLOAT64);\r
       setPixelSize (sizeof(kfloat64));\r
@@ -159,14 +159,14 @@ ImageFile::comparativeStatistics (const ImageFile& imComp, double& d, double& r,
     double absErrorSum = 0.;
     double sqDiffFromMeanSum = 0.;
     double absValueSum = 0.;
     double absErrorSum = 0.;
     double sqDiffFromMeanSum = 0.;
     double absValueSum = 0.;
-    for (unsigned int ix = 0; ix < m_nx; ix++) {
+    for (unsigned int ix2 = 0; ix2 < m_nx; ix2++) {
        for (unsigned int iy = 0; iy < m_ny; iy++) {
        for (unsigned int iy = 0; iy < m_ny; iy++) {
-           double diff = v[ix][iy] - vComp[ix][iy];
+           double diff = v[ix2][iy] - vComp[ix2][iy];
            sqErrorSum += diff * diff;
            absErrorSum += fabs(diff);
            sqErrorSum += diff * diff;
            absErrorSum += fabs(diff);
-           double diffFromMean = v[ix][iy] - myMean;
+           double diffFromMean = v[ix2][iy] - myMean;
            sqDiffFromMeanSum += diffFromMean * diffFromMean;
            sqDiffFromMeanSum += diffFromMean * diffFromMean;
-           absValueSum += fabs(v[ix][iy]);
+           absValueSum += fabs(v[ix2][iy]);
        }
     }
 
        }
     }
 
@@ -176,10 +176,10 @@ ImageFile::comparativeStatistics (const ImageFile& imComp, double& d, double& r,
     int hx = m_nx / 2;
     int hy = m_ny / 2;
     double eMax = -1;
     int hx = m_nx / 2;
     int hy = m_ny / 2;
     double eMax = -1;
-    for (int ix = 0; ix < hx; ix++) {
+    for (int ix3 = 0; ix3 < hx; ix3++) {
       for (int iy = 0; iy < hy; iy++) {
       for (int iy = 0; iy < hy; iy++) {
-       double avgPixel = 0.25 * (v[2*ix][2*iy] + v[2*ix+1][2*iy] + v[2*ix][2*iy+1] + v[2*ix+1][2*iy+1]);
-       double avgPixelComp = 0.25 * (vComp[2*ix][2*iy] + vComp[2*ix+1][2*iy] + vComp[2*ix][2*iy+1] + vComp[2*ix+1][2*iy+1]);
+       double avgPixel = 0.25 * (v[2*ix3][2*iy] + v[2*ix3+1][2*iy] + v[2*ix3][2*iy+1] + v[2*ix3+1][2*iy+1]);
+       double avgPixelComp = 0.25 * (vComp[2*ix3][2*iy] + vComp[2*ix3+1][2*iy] + vComp[2*ix3][2*iy+1] + vComp[2*ix3+1][2*iy+1]);
        double error = fabs (avgPixel - avgPixelComp);
        if (error > eMax)
          eMax = error;
        double error = fabs (avgPixel - avgPixelComp);
        if (error > eMax)
          eMax = error;
@@ -252,9 +252,9 @@ ImageFile::statistics (double& min, double& max, double& mean, double& mode, dou
     double spread = max - min;
     mode = 0;
     stddev = 0;
     double spread = max - min;
     mode = 0;
     stddev = 0;
-    for (int ix = 0; ix < nx; ix++) {
+    for (int ix4 = 0; ix4 < nx; ix4++) {
       for (int iy = 0; iy < ny; iy++) {
       for (int iy = 0; iy < ny; iy++) {
-       int b = static_cast<int>((((v[ix][iy] - min) / spread) * (nbin - 1)) + 0.5);
+       int b = static_cast<int>((((v[ix4][iy] - min) / spread) * (nbin - 1)) + 0.5);
        hist[b]++;
        double diff = (v[ix][iy] - mean);
        stddev += diff * diff;
        hist[b]++;
        double diff = (v[ix][iy] - mean);
        stddev += diff * diff;
@@ -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;
     mode = (max_binindex * spread / (nbin - 1)) + min;
 
     int nPixels = nx * ny;
-    slist<double> vecImage;
-    for (int ix = 0; ix < nx; ix++)
+    list<double> vecImage;
+    for (int ix5 = 0; ix5 < nx; ix5++)
       for (int iy = 0; iy < ny; iy++)
       for (int iy = 0; iy < ny; iy++)
-       vecImage.push_front (v[ix][iy]);
+       vecImage.push_front (v[ix5][iy]);
     vecImage.sort();
     vecImage.sort();
-    slist<double>::const_iterator iter = vecImage.begin();
+    list<double>::const_iterator iter = vecImage.begin();
     for (int i = 0; i < (nPixels / 2) - 1; i++)
       iter++; // Advance iterator to (nPixels / 2) - 1;
 
     for (int i = 0; i < (nPixels / 2) - 1; i++)
       iter++; // Advance iterator to (nPixels / 2) - 1;
 
@@ -321,7 +321,7 @@ ImageFile::writeImagePGM (const char *outfile, int nxcell, int nycell, double de
   int ny = m_ny;
   ImageFileArray v = getArray();
 
   int ny = m_ny;
   ImageFileArray v = getArray();
 
-  unsigned char rowp [nx * nxcell];
+  unsigned char* rowp = new unsigned char [nx * nxcell];
 
   if ((fp = fopen (outfile, "wb")) == NULL)
      return;
 
   if ((fp = fopen (outfile, "wb")) == NULL)
      return;
@@ -344,7 +344,8 @@ ImageFile::writeImagePGM (const char *outfile, int nxcell, int nycell, double de
        fputc( rowp[ic], fp );
     }
   }
        fputc( rowp[ic], fp );
     }
   }
-
+\r
+  delete rowp;
   fclose(fp);
 }
 
   fclose(fp);
 }
 
@@ -356,7 +357,7 @@ ImageFile::writeImagePGMASCII (const char *outfile, int nxcell, int nycell, doub
   int ny = m_ny;
   ImageFileArray v = getArray();
 
   int ny = m_ny;
   ImageFileArray v = getArray();
 
-  unsigned char rowp [nx * nxcell];
+  unsigned char* rowp = new unsigned char [nx * nxcell];
 
   if ((fp = fopen (outfile, "wb")) == NULL)
      return;
 
   if ((fp = fopen (outfile, "wb")) == NULL)
      return;
@@ -380,7 +381,8 @@ ImageFile::writeImagePGMASCII (const char *outfile, int nxcell, int nycell, doub
       fprintf(fp, "\n");
     }
   }
       fprintf(fp, "\n");
     }
   }
-
+\r
+  delete rowp;
   fclose(fp);
 }
 
   fclose(fp);
 }
 
index 6058ce77e947c6789bb8919088d54b1b8d25474a..6e3537dbe4757fd1e787e94d8ad08e697e0fcfdd 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: phantom.cpp,v 1.20 2000/12/04 05:36:57 kevin Exp $
+**  $Id: phantom.cpp,v 1.21 2000/12/06 01:46:43 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
 **
 **  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
@@ -27,8 +27,8 @@
 
 #include "ct.h"
 
 
 #include "ct.h"
 
-const int Phantom::POINTS_PER_CIRCLE = 360;\r
-const double Phantom::SCALE_PELEM_EXTENT=0.005;  // increase pelem limits by 0.5% \r
+const int PhantomElement::POINTS_PER_CIRCLE = 360;\r
+const double PhantomElement::SCALE_PELEM_EXTENT=0.005;  // increase pelem limits by 0.5% \r
 
 const int Phantom::PHM_INVALID = -1;
 const int Phantom::PHM_HERMAN = 0;
 
 const int Phantom::PHM_INVALID = -1;
 const int Phantom::PHM_HERMAN = 0;
index 5a52c03c300ea3108787bc8ad17dc4356a04c557..db00df703287c9e9a045e3bcc8a2091b70d7d2da 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: procsignal.cpp,v 1.7 2000/09/07 14:29:05 kevin Exp $
+**  $Id: procsignal.cpp,v 1.8 2000/12/06 01:46:43 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
 **
 **  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
@@ -176,7 +176,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        m_dFilterInc = (m_dFilterMax - m_dFilterMin) / (m_nFilterPoints - 1);
        SignalFilter filter (m_idFilter, m_dFilterMin, m_dFilterMax, m_nFilterPoints, m_dBandwidth, m_dFilterParam, SignalFilter::DOMAIN_FREQUENCY);
        m_adFilter = new double[ m_nFilterPoints ];
        m_dFilterInc = (m_dFilterMax - m_dFilterMin) / (m_nFilterPoints - 1);
        SignalFilter filter (m_idFilter, m_dFilterMin, m_dFilterMax, m_nFilterPoints, m_dBandwidth, m_dFilterParam, SignalFilter::DOMAIN_FREQUENCY);
        m_adFilter = new double[ m_nFilterPoints ];
-       double adFrequencyFilter [m_nFilterPoints];
+       double* adFrequencyFilter = new double [m_nFilterPoints];
        filter.copyFilterData (adFrequencyFilter, 0, m_nFilterPoints);
 #ifdef HAVE_SGP
        EZPlot* pEZPlot = NULL;
        filter.copyFilterData (adFrequencyFilter, 0, m_nFilterPoints);
 #ifdef HAVE_SGP
        EZPlot* pEZPlot = NULL;
@@ -199,6 +199,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        }
 #endif
        ProcessSignal::finiteFourierTransform (adFrequencyFilter, m_adFilter, m_nFilterPoints, -1);
        }
 #endif
        ProcessSignal::finiteFourierTransform (adFrequencyFilter, m_adFilter, m_nFilterPoints, -1);
+       delete adFrequencyFilter;\r
 #ifdef HAVE_SGP
        if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
          pEZPlot->ezset ("title Inverse Fourier Frequency: Fourier Order");
 #ifdef HAVE_SGP
        if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
          pEZPlot->ezset ("title Inverse Fourier Frequency: Fourier Order");
@@ -333,7 +334,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
       if (m_traceLevel >= Trace::TRACE_CONSOLE)
        cout << "nFilterPoints = " << m_nFilterPoints << endl;
 #endif
       if (m_traceLevel >= Trace::TRACE_CONSOLE)
        cout << "nFilterPoints = " << m_nFilterPoints << endl;
 #endif
-      double adSpatialFilter [m_nFilterPoints];
+      double* adSpatialFilter = new double [m_nFilterPoints];\r
       SignalFilter filter (m_idFilter, m_dFilterMin, m_dFilterMax, nSpatialPoints, m_dBandwidth, m_dFilterParam, SignalFilter::DOMAIN_SPATIAL);
       filter.copyFilterData (adSpatialFilter, 0, nSpatialPoints);
 #ifdef HAVE_SGP
       SignalFilter filter (m_idFilter, m_dFilterMin, m_dFilterMax, nSpatialPoints, m_dBandwidth, m_dFilterParam, SignalFilter::DOMAIN_SPATIAL);
       filter.copyFilterData (adSpatialFilter, 0, nSpatialPoints);
 #ifdef HAVE_SGP
@@ -362,15 +363,18 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
          double dScale = 0.5 * sinScale * sinScale;
          adSpatialFilter[i] *= dScale;
        }
          double dScale = 0.5 * sinScale * sinScale;
          adSpatialFilter[i] *= dScale;
        }
-      }
-      for (int i = nSpatialPoints; i < m_nFilterPoints; i++)
+      }\r
+         int i;
+      for (i = nSpatialPoints; i < m_nFilterPoints; i++)
        adSpatialFilter[i] = 0;
 
       m_adFilter = new double [m_nFilterPoints];
        adSpatialFilter[i] = 0;
 
       m_adFilter = new double [m_nFilterPoints];
-      complex<double> acInverseFilter [m_nFilterPoints];
+      complex<double>* acInverseFilter = new complex<double> [m_nFilterPoints];\r
       finiteFourierTransform (adSpatialFilter, acInverseFilter, m_nFilterPoints, 1);
       finiteFourierTransform (adSpatialFilter, acInverseFilter, m_nFilterPoints, 1);
-      for (int i = 0; i < m_nFilterPoints; i++)
-       m_adFilter[i] = abs(acInverseFilter[i]) * m_dSignalInc;
+       delete adSpatialFilter;\r
+       for (i = 0; i < m_nFilterPoints; i++)
+         m_adFilter[i] = abs(acInverseFilter[i]) * m_dSignalInc;
+       delete acInverseFilter;\r
 #ifdef HAVE_SGP
       if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
        pEZPlot->ezset ("title Spatial Filter: Inverse");
 #ifdef HAVE_SGP
       if (pEZPlot && m_traceLevel >= Trace::TRACE_PLOT) {
        pEZPlot->ezset ("title Spatial Filter: Inverse");
@@ -378,7 +382,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
        pEZPlot->ezset ("yporigin 0.50");
        pEZPlot->addCurve (m_adFilter, m_nFilterPoints);
        pEZPlot->plot();
        pEZPlot->ezset ("yporigin 0.50");
        pEZPlot->addCurve (m_adFilter, m_nFilterPoints);
        pEZPlot->plot();
-       delete pEZPlot;
+       delete pEZPlot;\r
       }
 #endif
     }
       }
 #endif
     }
@@ -386,7 +390,7 @@ ProcessSignal::init (const int idFilter, const int idFilterMethod, double dBandw
   
   // precalculate sin and cosine tables for fourier transform
   if (m_idFilterMethod == FILTER_METHOD_FOURIER_TABLE) {
   
   // precalculate sin and cosine tables for fourier transform
   if (m_idFilterMethod == FILTER_METHOD_FOURIER_TABLE) {
-    int nFourier = max(m_nFilterPoints,m_nOutputPoints) * max(m_nFilterPoints, m_nOutputPoints) + 1;
+    int nFourier = imax (m_nFilterPoints,m_nOutputPoints) * imax (m_nFilterPoints, m_nOutputPoints) + 1;
     double angleIncrement = (2. * PI) / m_nFilterPoints;
     m_adFourierCosTable = new double[ nFourier ];
     m_adFourierSinTable = new double[ nFourier ];
     double angleIncrement = (2. * PI) / m_nFilterPoints;
     m_adFourierCosTable = new double[ nFourier ];
     m_adFourierSinTable = new double[ nFourier ];
@@ -523,8 +527,9 @@ ProcessSignal::convertFilterGenerationIDToTitle (const int fgID)
 void
 ProcessSignal::filterSignal (const float constInput[], double output[]) const
 {
 void
 ProcessSignal::filterSignal (const float constInput[], double output[]) const
 {
-  double input [m_nSignalPoints];
-  for (int i = 0; i < m_nSignalPoints; i++)
+  double* input = new double [m_nSignalPoints];
+  int i;\r
+  for (i = 0; i < m_nSignalPoints; i++)
     input[i] = constInput[i];
 
   if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) {
     input[i] = constInput[i];
 
   if (m_idGeometry == Scanner::GEOMETRY_EQUILINEAR) {
@@ -537,38 +542,44 @@ ProcessSignal::filterSignal (const float constInput[], double output[]) const
       int iDetFromCenter = i - (m_nSignalPoints / 2);
       input[i] *= m_dFocalLength * cos (iDetFromCenter * m_dSignalInc);
     }
       int iDetFromCenter = i - (m_nSignalPoints / 2);
       input[i] *= m_dFocalLength * cos (iDetFromCenter * m_dSignalInc);
     }
-  }
+  }\r
   if (m_idFilterMethod == FILTER_METHOD_CONVOLUTION) {
   if (m_idFilterMethod == FILTER_METHOD_CONVOLUTION) {
-      for (int i = 0; i < m_nSignalPoints; i++)
+      for (i = 0; i < m_nSignalPoints; i++)
        output[i] = convolve (input, m_dSignalInc, i, m_nSignalPoints);
   } else if (m_idFilterMethod == FILTER_METHOD_FOURIER) {
        output[i] = convolve (input, m_dSignalInc, i, m_nSignalPoints);
   } else if (m_idFilterMethod == FILTER_METHOD_FOURIER) {
-    double inputSignal[m_nFilterPoints];
-    for (int i = 0; i < m_nSignalPoints; i++)
+    double* inputSignal = new double [m_nFilterPoints];
+    for (i = 0; i < m_nSignalPoints; i++)
       inputSignal[i] = input[i];
       inputSignal[i] = input[i];
-    for (int i = m_nSignalPoints; i < m_nFilterPoints; i++)
+    for (i = m_nSignalPoints; i < m_nFilterPoints; i++)
       inputSignal[i] = 0;  // zeropad
       inputSignal[i] = 0;  // zeropad
-    complex<double> fftSignal[m_nFilterPoints];
-    finiteFourierTransform (inputSignal, fftSignal, m_nFilterPoints, -1);
-    for (int i = 0; i < m_nFilterPoints; i++)
+    complex<double>* fftSignal = new complex<double> [m_nFilterPoints];
+    finiteFourierTransform (inputSignal, fftSignal, m_nFilterPoints, -1);\r
+       delete inputSignal;
+    for (i = 0; i < m_nFilterPoints; i++)
       fftSignal[i] *= m_adFilter[i];
       fftSignal[i] *= m_adFilter[i];
-    double inverseFourier[m_nFilterPoints];
-    finiteFourierTransform (fftSignal, inverseFourier, m_nFilterPoints, 1);
-    for (int i = 0; i < m_nSignalPoints; i++) 
-      output[i] = inverseFourier[i];
+    double* inverseFourier = new double [m_nFilterPoints];
+    finiteFourierTransform (fftSignal, inverseFourier, m_nFilterPoints, 1);\r
+       delete fftSignal;
+    for (i = 0; i < m_nSignalPoints; i++) 
+      output[i] = inverseFourier[i];\r
+       delete inverseFourier;
   } else if (m_idFilterMethod == FILTER_METHOD_FOURIER_TABLE) {
   } else if (m_idFilterMethod == FILTER_METHOD_FOURIER_TABLE) {
-    double inputSignal[m_nFilterPoints];
-    for (int i = 0; i < m_nSignalPoints; i++)
+    double* inputSignal = new double [m_nFilterPoints];
+    for (i = 0; i < m_nSignalPoints; i++)
       inputSignal[i] = input[i];
       inputSignal[i] = input[i];
-    for (int i = m_nSignalPoints; i < m_nFilterPoints; i++)
+    for (i = m_nSignalPoints; i < m_nFilterPoints; i++)
       inputSignal[i] = 0;  // zeropad
       inputSignal[i] = 0;  // zeropad
-    complex<double> fftSignal[m_nFilterPoints];
-    finiteFourierTransform (inputSignal, fftSignal, -1);
-    for (int i = 0; i < m_nFilterPoints; i++)
+    complex<double>* fftSignal = new complex<double> [m_nFilterPoints];
+    finiteFourierTransform (inputSignal, fftSignal, -1);\r
+       delete inputSignal;
+    for (i = 0; i < m_nFilterPoints; i++)
       fftSignal[i] *= m_adFilter[i];
       fftSignal[i] *= m_adFilter[i];
-    double inverseFourier[m_nFilterPoints];
-    finiteFourierTransform (fftSignal, inverseFourier, 1);
-    for (int i = 0; i < m_nSignalPoints; i++) 
-      output[i] = inverseFourier[i];
+    double* inverseFourier = new double [m_nFilterPoints];
+    finiteFourierTransform (fftSignal, inverseFourier, 1);\r
+       delete fftSignal;
+    for (i = 0; i < m_nSignalPoints; i++) 
+      output[i] = inverseFourier[i];\r
+       delete inverseFourier;
   }
 #if HAVE_FFTW
   else if (m_idFilterMethod == FILTER_METHOD_RFFTW) {
   }
 #if HAVE_FFTW
   else if (m_idFilterMethod == FILTER_METHOD_RFFTW) {
@@ -601,7 +612,8 @@ ProcessSignal::filterSignal (const float constInput[], double output[]) const
       for (int i = 0; i < m_nSignalPoints * m_iPreinterpolationFactor; i++) 
          output[i] = ifftOutput[i].re;
   }
       for (int i = 0; i < m_nSignalPoints * m_iPreinterpolationFactor; i++) 
          output[i] = ifftOutput[i].re;
   }
-#endif
+#endif\r
+  delete input;
 }
 
 
 }
 
 
@@ -670,11 +682,12 @@ for (int i = 0; i < np; i++)
 void
 ProcessSignal::finiteFourierTransform (const double input[], double output[], const int n, int direction)
 {
 void
 ProcessSignal::finiteFourierTransform (const double input[], double output[], const int n, int direction)
 {
-    complex<double> complexOutput[n];
+    complex<double>* complexOutput = new complex<double> [n];
 
     finiteFourierTransform (input, complexOutput, n, direction);
     for (int i = 0; i < n; i++)
 
     finiteFourierTransform (input, complexOutput, n, direction);
     for (int i = 0; i < n; i++)
-       output[i] = complexOutput[i].real();
+       output[i] = complexOutput[i].real();\r
+       delete [] complexOutput;
 }
 
 void
 }
 
 void
@@ -848,25 +861,26 @@ ProcessSignal::finiteFourierTransform (const complex<double> input[], double out
 void
 ProcessSignal::shuffleNaturalToFourierOrder (double* pdVector, const int n)
 {
 void
 ProcessSignal::shuffleNaturalToFourierOrder (double* pdVector, const int n)
 {
-  double* pdTemp = new double [n];
+  double* pdTemp = new double [n];\r
+  int i;
   if (n % 2) { // Odd
     int iHalfN = (n - 1) / 2;
     
     pdTemp[0] = pdVector[iHalfN];
   if (n % 2) { // Odd
     int iHalfN = (n - 1) / 2;
     
     pdTemp[0] = pdVector[iHalfN];
-    for (int i = 0; i < iHalfN; i++)
+    for (i = 0; i < iHalfN; i++)
       pdTemp[i + 1] = pdVector[i + 1 + iHalfN];
       pdTemp[i + 1] = pdVector[i + 1 + iHalfN];
-    for (int i = 0; i < iHalfN; i++)
+    for (i = 0; i < iHalfN; i++)
       pdTemp[i + iHalfN + 1] = pdVector[i];
   } else {     // Even
       int iHalfN = n / 2;
       pdTemp[0] = pdVector[iHalfN];
       pdTemp[i + iHalfN + 1] = pdVector[i];
   } else {     // Even
       int iHalfN = n / 2;
       pdTemp[0] = pdVector[iHalfN];
-      for (int i = 0; i < iHalfN; i++)
+      for (i = 0; i < iHalfN; i++)
        pdTemp[i + 1] = pdVector[i + iHalfN];
        pdTemp[i + 1] = pdVector[i + iHalfN];
-      for (int i = 0; i < iHalfN - 1; i++)
+      for (i = 0; i < iHalfN - 1; i++)
        pdTemp[i + iHalfN + 1] = pdVector[i];
   }
 
        pdTemp[i + iHalfN + 1] = pdVector[i];
   }
 
-  for (int i = 0; i < n; i++)
+  for (i = 0; i < n; i++)
     pdVector[i] = pdTemp[i];
   delete pdTemp;
 }
     pdVector[i] = pdTemp[i];
   delete pdTemp;
 }
@@ -875,25 +889,26 @@ ProcessSignal::shuffleNaturalToFourierOrder (double* pdVector, const int n)
 void
 ProcessSignal::shuffleFourierToNaturalOrder (double* pdVector, const int n)
 {
 void
 ProcessSignal::shuffleFourierToNaturalOrder (double* pdVector, const int n)
 {
-  double* pdTemp = new double [n];
+  double* pdTemp = new double [n];\r
+  int i;
   if (n % 2) { // Odd
     int iHalfN = (n - 1) / 2;
     
   if (n % 2) { // Odd
     int iHalfN = (n - 1) / 2;
     
-    pdTemp[iHalfN] = pdVector[0];
-    for (int i = 0; i < iHalfN; i++)
+    pdTemp[iHalfN] = pdVector[0];\r
+       for (i = 0; i < iHalfN; i++)
       pdTemp[i + 1 + iHalfN] = pdVector[i + 1];
       pdTemp[i + 1 + iHalfN] = pdVector[i + 1];
-    for (int i = 0; i < iHalfN; i++)
+    for (i = 0; i < iHalfN; i++)
       pdTemp[i] = pdVector[i + iHalfN + 1];
   } else {     // Even
       int iHalfN = n / 2;
       pdTemp[iHalfN] = pdVector[0];
       pdTemp[i] = pdVector[i + iHalfN + 1];
   } else {     // Even
       int iHalfN = n / 2;
       pdTemp[iHalfN] = pdVector[0];
-      for (int i = 0; i < iHalfN; i++)
+      for (i = 0; i < iHalfN; i++)
        pdTemp[i] = pdVector[i + iHalfN];
        pdTemp[i] = pdVector[i + iHalfN];
-      for (int i = 0; i < iHalfN - 1; i++)
+      for (i = 0; i < iHalfN - 1; i++)
        pdTemp[i + iHalfN + 1] = pdVector[i+1];
   }
 
        pdTemp[i + iHalfN + 1] = pdVector[i+1];
   }
 
-  for (int i = 0; i < n; i++)
+  for (i = 0; i < n; i++)
     pdVector[i] = pdTemp[i];
   delete pdTemp;
 }
     pdVector[i] = pdTemp[i];
   delete pdTemp;
 }
index ea3074b486bf68da1424c6c2cf3b810532c78ba5..7de82039d629517652649bf741ede6ae4a5f454b 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: projections.cpp,v 1.27 2000/12/04 05:36:57 kevin Exp $
+**  $Id: projections.cpp,v 1.28 2000/12/06 01:46:43 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
 **
 **  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
@@ -254,14 +254,15 @@ Projections::headerRead (fnetorderstream& fs)
     return false;
   }
 
     return false;
   }
 
-  char remarkStorage[_remarksize+1];
-  fs.read (remarkStorage, _remarksize);
+  char* pszRemarkStorage = new char [_remarksize+1];
+  fs.read (pszRemarkStorage, _remarksize);
   if (! fs) {
     sys_error (ERR_SEVERE, "Error reading remark, _remarksize = %d", _remarksize);
     return false;
   }
   if (! fs) {
     sys_error (ERR_SEVERE, "Error reading remark, _remarksize = %d", _remarksize);
     return false;
   }
-  remarkStorage[_remarksize] = 0;
-  m_remark = remarkStorage;
+  pszRemarkStorage[_remarksize] = 0;
+  m_remark = pszRemarkStorage;
+  delete pszRemarkStorage;\r
 
   off_t _hsizeread = fs.tellg();
   if (!fs || _hsizeread != _hsize) {
 
   off_t _hsizeread = fs.tellg();
   if (!fs || _hsizeread != _hsize) {
index 8e09a16b55be487ecba1c568ad835bdcfb3dd7b6..58f17bc9ac7e7bfc530f446246cc5cf3d388a134 100644 (file)
@@ -8,7 +8,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: reconstruct.cpp,v 1.1 2000/09/02 05:13:57 kevin Exp $
+**  $Id: reconstruct.cpp,v 1.2 2000/12/06 01:46:43 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
 **
 **  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
@@ -139,7 +139,7 @@ Reconstructor::reconstructAllViews ()
 void
 Reconstructor::reconstructView (int iStartView, int iViewCount, SGP* pSGP)
 {
 void
 Reconstructor::reconstructView (int iStartView, int iViewCount, SGP* pSGP)
 {
-  double adFilteredProj [m_nFilteredProjections];   // filtered projections
+  double* adFilteredProj = new double [m_nFilteredProjections];   // filtered projections
 
   if (iViewCount <= 0)
     iViewCount = m_rProj.nView() - iStartView;
 
   if (iViewCount <= 0)
     iViewCount = m_rProj.nView() - iStartView;
@@ -195,5 +195,7 @@ Reconstructor::reconstructView (int iStartView, int iViewCount, SGP* pSGP)
     } 
 #endif  //HAVE_SGP
   }
     } 
 #endif  //HAVE_SGP
   }
+\r
+  delete adFilteredProj;\r
 }
 
 }
 
index 77fbb1e7510ba0e9af77b1a70a168b739d9485d3..c8c86632d1c15924cf9e9f4794ed8be6b9703c9a 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: scanner.cpp,v 1.16 2000/12/03 12:22:46 kevin Exp $
+**  $Id: scanner.cpp,v 1.17 2000/12/06 01:46:43 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
 **
 **  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
@@ -260,7 +260,7 @@ Scanner::collectProjections (Projections& proj, const Phantom& phm, const int tr
 }
 
 void
 }
 
 void
-Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iStartView, const int iNumViews, bool bStoreAtViewPosition, const int trace, SGP* pSGP = NULL)
+Scanner::collectProjections (Projections& proj, const Phantom& phm, const int iStartView, const int iNumViews, bool bStoreAtViewPosition, const int trace, SGP* pSGP)
 {
   m_trace = trace;
   double start_angle = iStartView * proj.rotInc();
 {
   m_trace = trace;
   double start_angle = iStartView * proj.rotInc();
@@ -532,7 +532,11 @@ Scanner::traceShowParamRasterOp (int iRasterOp, const char *szLabel, const char
 {  
   char szValue[256];
 
 {  
   char szValue[256];
 
-  vsnprintf (szValue, sizeof(szValue), fmt, args);
+#ifdef MSVC
+  vsprintf (szValue, fmt, args);
+#else
+  vnsprintf (szValue, sizeof(szValue), fmt, args);
+#endif
 
   //  cio_set_cpos (raysum_trace_menu_column, row);
   //  cio_set_text_clr (color - 8, 0);
 
   //  cio_set_cpos (raysum_trace_menu_column, row);
   //  cio_set_text_clr (color - 8, 0);
index f99c20fa46e0dec770bfdc50cbfe305f261a5896..2123c29f0fe6b9b6a63d141b3cb52efaa685e057 100644 (file)
@@ -14,7 +14,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: clip.cpp,v 1.4 2000/07/23 01:49:03 kevin Exp $
+**  $Id: clip.cpp,v 1.5 2000/12/06 01:46:43 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
 **
 **  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
@@ -331,7 +331,7 @@ tcode (const double x, const double y, const double m, const double b, const int
 
 static int rectcode (double x, double y, const double rect[4]);
 
 
 static int rectcode (double x, double y, const double rect[4]);
 
-int 
+bool\r
 clip_rect (double& x1, double& y1, double& x2, double& y2, const double rect[4])
 {
   double x = 0, y = 0;
 clip_rect (double& x1, double& y1, double& x2, double& y2, const double rect[4])
 {
   double x = 0, y = 0;
index 6d0900dcda89511de3eb3c7c3286246bb7ce78b1..06ee4eedbda42e77c43565d9d34847609666e1af 100644 (file)
@@ -2,7 +2,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: syserror.cpp,v 1.6 2000/09/07 04:31:41 kevin Exp $
+**  $Id: syserror.cpp,v 1.7 2000/12/06 01:46:43 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
 **
 **  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
@@ -65,27 +65,27 @@ void sys_verror (int severity, const char *msg, va_list arg)
     if (nErrorCount > MAX_ERROR_COUNT)
       return;
     else if (nErrorCount == MAX_ERROR_COUNT) {
     if (nErrorCount > MAX_ERROR_COUNT)
       return;
     else if (nErrorCount == MAX_ERROR_COUNT) {
-      cout << "*****************************************************************" << endl;
-      cout << "***   M A X I M U M   E R R O R   C O U N T   R E A C H E D   ***" << endl;
-      cout << "***                                                           ***" << endl;
-      cout << "***           No further errors will be reported              ***" << endl;
-      cout << "*****************************************************************" << endl;
+               std::cout << "*****************************************************************\n";
+               std::cout << "***   M A X I M U M   E R R O R   C O U N T   R E A C H E D   ***\n";
+               std::cout << "***                                                           ***\n";
+               std::cout << "***           No further errors will be reported              ***\n";
+               std::cout << "*****************************************************************\n";
       return;
     }
   }
     
   switch (severity) {
   case ERR_FATAL:
       return;
     }
   }
     
   switch (severity) {
   case ERR_FATAL:
-    cout << "FATAL ERROR: ";
+         std::cout << "FATAL ERROR: ";
     break;
   case ERR_SEVERE:
     break;
   case ERR_SEVERE:
-    cout << "SEVERE ERROR: ";
+         std::cout << "SEVERE ERROR: ";
     break;
   case ERR_WARNING:
     break;
   case ERR_WARNING:
-    cout << "WARNING ERROR: ";
+         std::cout << "WARNING ERROR: ";
     break;
   default:
     break;
   default:
-    cout << "Illegal error code #" << severity << ": ";
+         std::cout << "Illegal error code #" << severity << ": ";
   }
   
   char errStr[512];
   }
   
   char errStr[512];
@@ -95,13 +95,13 @@ void sys_verror (int severity, const char *msg, va_list arg)
   vsprintf (errStr, msg, arg);
 #endif
 
   vsprintf (errStr, msg, arg);
 #endif
 
-  cout << errStr << endl;
+  std::cout << errStr << std::endl;
   
   if (severity == ERR_FATAL)
   
   if (severity == ERR_FATAL)
-    throw runtime_error (errStr);
+         throw std::runtime_error (errStr);
   
 #if INTERACTIVE_ERROR_DISPLAY
   
 #if INTERACTIVE_ERROR_DISPLAY
-  cout << "A - Abort  C - Continue  W - Turn off warnings? ";
+  std::cout << "A - Abort  C - Continue  W - Turn off warnings? ";
   //  fflush(stderr);
   do 
    {
   //  fflush(stderr);
   do 
    {