** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.23 2000/10/11 08:16:08 kevin Exp $
+** $Id: views.cpp,v 1.24 2000/12/16 03:29:02 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 nx = rIF.nx();
int ny = rIF.ny();
- if (pt.x >= 0 && pt.x < nx && pt.y >= 0 & pt.y < ny) {
+ if (pt.x >= 0 && pt.x < nx && pt.y >= 0 && pt.y < ny) {
ostringstream os;
os << "Image value (" << pt.x << "," << pt.y << ") = " << v[pt.x][ny - 1 - pt.y] << "\n";
*theApp->getLog() << os.str().c_str();
unsigned char* imageData = new unsigned char [nDet * nView * 3];
double scale = (max - min) / 255;
- for (int iy = 0; iy < nView; iy++) {
- const DetectorArray& detarray = rProj.getDetectorArray(iy);
+ for (int iy2 = 0; iy2 < nView; iy2++) {
+ const DetectorArray& detarray = rProj.getDetectorArray (iy2);
const DetectorValue* detval = detarray.detValues();
for (int ix = 0; ix < nDet; ix++) {
int intensity = static_cast<int>(((detval[ix] - min) / scale) + 0.5);
intensity = clamp(intensity, 0, 255);
- int baseAddr = (iy * nDet + ix) * 3;
+ int baseAddr = (iy2 * nDet + ix) * 3;
imageData[baseAddr] = imageData[baseAddr+1] = imageData[baseAddr+2] = intensity;
}
}