X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fviews.cpp;h=e94ca255c4563dd440d1419f2bdc099160292f5c;hp=8ceaf03501b79bd47e73e223d02ef27aa1b10c61;hb=484b9ac2ebf8f88dbe36bdc1d3a9c1b6a2b242eb;hpb=07fbc7c8c9cf0e9de956284d6057a825c81ae0ce diff --git a/src/views.cpp b/src/views.cpp index 8ceaf03..e94ca25 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** 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 @@ -96,7 +96,7 @@ ImageFileCanvas::OnMouseEvent(wxMouseEvent& event) 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(); @@ -912,13 +912,13 @@ ProjectionFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) 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(((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; } }