** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: imagefile.cpp,v 1.22 2000/12/20 20:08:48 kevin Exp $
+** $Id: imagefile.cpp,v 1.23 2000/12/21 03:40:58 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 (v == NULL || nx == 0 || ny == 0)
return;
\r
- std::vector<double> vecImage (nx * ny);\r
+ std::vector<double> vecImage;\r
+ int iVec = 0;\r
+ vecImage.resize (nx * ny);\r
for (int ix = 0; ix < nx; ix++) {\r
for (int iy = 0; iy < ny; iy++)\r
- vecImage.push_back (v[ix][iy]);\r
+ vecImage[iVec++] = v[ix][iy];\r
}\r
\r
- vectorNumericStatistics (vecImage, min, max, mean, mode, median, stddev);\r
+ vectorNumericStatistics (vecImage, nx * ny, min, max, mean, mode, median, stddev);\r
}