X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fviews.cpp;h=1e28647cc9f1868223d8759c553555a8bffe5b72;hb=3b09207d7c37bc3d48e331657353123ed2f66ed9;hp=888b9b46716570ab00697d918d04781ce24cdfa1;hpb=1ef49f39828474ed05fe69aff68d400e3b7d4044;p=ctsim.git diff --git a/src/views.cpp b/src/views.cpp index 888b9b4..1e28647 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.cpp,v 1.115 2001/02/23 18:56:56 kevin Exp $ +** $Id: views.cpp,v 1.117 2001/02/25 06:32:12 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 @@ -113,6 +113,7 @@ ImageFileCanvas::OnMouseEvent(wxMouseEvent& event) { if (! m_pView) return; + wxClientDC dc(this); PrepareDC(dc); @@ -1001,6 +1002,10 @@ ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) ) double scaleWidth = m_dMaxPixel - m_dMinPixel; unsigned char* imageData = new unsigned char [nx * ny * 3]; + if (! imageData) { + sys_error (ERR_SEVERE, "Unable to allocate memory for Image display"); + return; + } for (int ix = 0; ix < nx; ix++) { for (int iy = 0; iy < ny; iy++) { double scaleValue = ((v[ix][iy] - m_dMinPixel) / scaleWidth) * 255; @@ -2434,15 +2439,17 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) } else { if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { - ReconstructorSupervisor* pReconstructor = new ReconstructorSupervisor (this, + ReconstructorSupervisorThread* pReconstructor = new ReconstructorSupervisorThread (this, m_iDefaultNX, m_iDefaultNY, optFilterName.c_str(), m_dDefaultFilterParam, optFilterMethodName.c_str(), m_iDefaultZeropad, optFilterGenerationName.c_str(), optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), os.str().c_str()); - if (! pReconstructor->start()) { + if (pReconstructor->Create() != wxTHREAD_NO_ERROR) { + sys_error (ERR_SEVERE, "Error creating reconstructor thread"); delete pReconstructor; return; } - // delete pReconstructor; // reconstructor is still running +// pReconstructor->SetPriority (60); + pReconstructor->Run(); } else { ImageFile* pImageFile = new ImageFile; pImageFile->setArraySize (m_iDefaultNX, m_iDefaultNY); @@ -2637,6 +2644,10 @@ ProjectionFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) } unsigned char* imageData = new unsigned char [nDet * nView * 3]; + if (! imageData) { + sys_error (ERR_SEVERE, "Unable to allocate memory for image display"); + return; + } double scale = (max - min) / 255; for (int iy2 = 0; iy2 < nView; iy2++) { const DetectorArray& detarray = rProj.getDetectorArray (iy2);