r245: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 4 Dec 2000 19:50:57 +0000 (19:50 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 4 Dec 2000 19:50:57 +0000 (19:50 +0000)
libctsim/array2dfile.cpp
libctsim/backprojectors.cpp
libctsim/filter.cpp

index f918471f54e7278a5789f5095efddaae9f091231..2999470e871e85af572312a63f941e796ab9ae0a 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.13 2000/12/04 04:15:48 kevin Exp $
+**  $Id: array2dfile.cpp,v 1.14 2000/12/04 19:50:57 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
@@ -278,7 +278,11 @@ Array2dFile::fileRead (const char* const filename)
 {
     m_filename = filename;
 
 {
     m_filename = filename;
 
-    frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary | ios::nocreate);
+#ifdef MSVC\r
+    frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary);\r
+#else\r
+    frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary | ios::nocreate);\r
+#endif\r
     if (fs.fail()) {
       sys_error (ERR_WARNING, "Unable to open file %s [fileRead]", m_filename.c_str());
       return false;
     if (fs.fail()) {
       sys_error (ERR_WARNING, "Unable to open file %s [fileRead]", m_filename.c_str());
       return false;
@@ -476,13 +480,15 @@ Array2dFile::labelsRead (frnetorderstream& fs)
        
        kuint16 strLength;
        fs.readInt16 (strLength);
        
        kuint16 strLength;
        fs.readInt16 (strLength);
-       char labelStr [strLength+1];
+       char* labelStr = new char [strLength+1];
        fs.read (labelStr, strLength);
        labelStr[strLength] = 0;
 
        Array2dFileLabel* pLabel = new Array2dFileLabel(labelType, labelStr, calcTime);
        fs.read (labelStr, strLength);
        labelStr[strLength] = 0;
 
        Array2dFileLabel* pLabel = new Array2dFileLabel(labelType, labelStr, calcTime);
+       delete labelStr;\r
+\r
        pLabel->setDateTime (year, month, day, hour, minute, second);
        pLabel->setDateTime (year, month, day, hour, minute, second);
-       m_labels.push_back (pLabel);
+       m_labels.push_back (pLabel);\r
     }
 
     return true;
     }
 
     return true;
index 152e026770059dcee869e6161d6d373639b85f5a..5f674ec48b9a287345d5d2adfbca537ee6bdc975 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.15 2000/12/03 15:16:18 kevin Exp $
+**  $Id: backprojectors.cpp,v 1.16 2000/12/04 19:50:57 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
@@ -256,7 +256,7 @@ Backprojector::convertInterpIDToTitle (const int interpID)
 // PURPOSE
 //   Pure virtual base class for all backprojectors.
 
 // PURPOSE
 //   Pure virtual base class for all backprojectors.
 
-Backproject::Backproject (const Projections& proj, ImageFile& im, const int interpType, const int interpFactor)
+Backproject::Backproject (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
     : proj(proj), im(im), interpType(interpType), m_interpFactor(interpFactor)
 {
   detInc = proj.detInc();
     : proj(proj), im(im), interpType(interpType), m_interpFactor(interpFactor)
 {
   detInc = proj.detInc();
@@ -599,7 +599,7 @@ BackprojectIntDiff3::BackprojectView (const double* const filteredProj, const do
   kint32 detPosColStart = nearest<kint32> ((start_r * cos (theta - start_phi) / detInc + iDetCenter) * scale);
        
   // precalculate scaled difference for linear interpolation
   kint32 detPosColStart = nearest<kint32> ((start_r * cos (theta - start_phi) / detInc + iDetCenter) * scale);
        
   // precalculate scaled difference for linear interpolation
-  double deltaFilteredProj [nDet];
+  double* deltaFilteredProj = new double [nDet];
   if (interpType == Backprojector::INTERP_LINEAR) {
     for (int i = 0; i < nDet - 1; i++)
       deltaFilteredProj[i] = (filteredProj[i+1] - filteredProj[i]) * dInvScale;
   if (interpType == Backprojector::INTERP_LINEAR) {
     for (int i = 0; i < nDet - 1; i++)
       deltaFilteredProj[i] = (filteredProj[i+1] - filteredProj[i]) * dInvScale;
@@ -631,7 +631,9 @@ BackprojectIntDiff3::BackprojectView (const double* const filteredProj, const do
          *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]);
       }        // end for iy
     } //end linear
          *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]);
       }        // end for iy
     } //end linear
-  } // end for ix
+  } // end for ix\r
+\r
+  delete deltaFilteredProj;
 }
 
 
 }
 
 
index ef479387aa99b1b55964ada39e1d1bd5e38a6ce9..5a4b0ef5fdccb6889b8b5012fb11a474c9f93630 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: filter.cpp,v 1.31 2000/11/28 14:54:29 kevin Exp $
+**  $Id: filter.cpp,v 1.32 2000/12/04 19:50:57 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
@@ -364,12 +364,13 @@ SignalFilter::spatialResponseCalc (int filterID, double bw, double x, double par
   double zinc = (zmax - zmin) / (n - 1);
 
   double z = zmin;
   double zinc = (zmax - zmin) / (n - 1);
 
   double z = zmin;
-  double q [n];
+  double* q = new double [n];
   for (int i = 0; i < n; i++, z += zinc)
     q[i] = frequencyResponse (filterID, bw, z, param) * cos (TWOPI * z * x);
   
   double y = 2 * integrateSimpson (zmin, zmax, q, n);
   for (int i = 0; i < n; i++, z += zinc)
     q[i] = frequencyResponse (filterID, bw, z, param) * cos (TWOPI * z * x);
   
   double y = 2 * integrateSimpson (zmin, zmax, q, n);
-  
+  delete q;\r
+
   return (y);
 }
 
   return (y);
 }