** 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
{
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;
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);
+ delete labelStr;\r
+\r
pLabel->setDateTime (year, month, day, hour, minute, second);
- m_labels.push_back (pLabel);
+ m_labels.push_back (pLabel);\r
}
return true;
** 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
// 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();
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;
*pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]);
} // end for iy
} //end linear
- } // end for ix
+ } // end for ix\r
+\r
+ delete deltaFilteredProj;
}
** 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
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);
-
+ delete q;\r
+
return (y);
}