X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fdlgreconstruct.cpp;h=f6e2182409ad775f9074d3e45986c33b31b3fb3f;hp=b7ad2c4dee7d28343a28394cd22e7147f25ad225;hb=484b9ac2ebf8f88dbe36bdc1d3a9c1b6a2b242eb;hpb=586af74e42519b0511311df711bab2b2be962629 diff --git a/src/dlgreconstruct.cpp b/src/dlgreconstruct.cpp index b7ad2c4..f6e2182 100644 --- a/src/dlgreconstruct.cpp +++ b/src/dlgreconstruct.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: dlgreconstruct.cpp,v 1.4 2000/09/04 09:24:21 kevin Exp $ +** $Id: dlgreconstruct.cpp,v 1.6 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 @@ -57,6 +57,13 @@ static const int LAYOUT_X_MARGIN = 4; static const int LAYOUT_Y_MARGIN = 4; + + +const int ReconstructDialog::ID_BTN_PAUSE = 19998; +const int ReconstructDialog::ID_BTN_STEP = 19999; +const int ReconstructDialog::MAX_IMAGE_X = 400; +const int ReconstructDialog::MAX_IMAGE_Y = 400; + BEGIN_EVENT_TABLE(ReconstructDialog, wxDialog) EVT_BUTTON(wxID_CANCEL, ReconstructDialog::OnCancel) @@ -70,7 +77,7 @@ IMPLEMENT_CLASS(ReconstructDialog, wxDialog) ReconstructDialog::ReconstructDialog (Reconstructor& rReconstruct, const Projections& rProj, ImageFile& rIF, const int iTrace, wxWindow *parent) - : wxDialog(parent, -1, "Reconstruction"), m_rReconstructor(rReconstruct), m_rProjections(rProj), m_rImageFile(rIF), m_pSGPDriver(NULL), m_pSGP(NULL), m_iTrace(iTrace), m_pDC(NULL), m_btnAbort(0), m_btnPause(0), m_btnStep(0) + : wxDialog(parent, -1, "Reconstruction", wxDefaultPosition), m_rReconstructor(rReconstruct), m_rProjections(rProj), m_rImageFile(rIF), m_pSGPDriver(NULL), m_pSGP(NULL), m_iTrace(iTrace), m_pDC(NULL), m_btnAbort(0), m_btnPause(0), m_btnStep(0) { m_state = Continue; m_iLastView = -1; @@ -189,13 +196,13 @@ ReconstructDialog::showView (int iViewNumber) } unsigned char* imageData = new unsigned char [m_nxImage * m_nyImage * 3]; double dScale = 255 / (maxValue - minValue); - for (int ix = 0; ix < m_nxImage; ix++) { + for (int ix2 = 0; ix2 < m_nxImage; ix2++) { for (int iy = 0; iy < m_nyImage; iy++) { - double dPixel = v[ix][iy]; + double dPixel = v[ix2][iy]; dPixel = (dPixel - minValue) * dScale; int intensity = nearest(dPixel); intensity = clamp (intensity, 0, 255); - int baseAddr = ((m_nyImage - 1 - iy) * m_nxImage + ix) * 3; + int baseAddr = ((m_nyImage - 1 - iy) * m_nxImage + ix2) * 3; imageData[baseAddr] = imageData[baseAddr+1] = imageData[baseAddr+2] = intensity; } }