X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fviews.cpp;h=8203cbc4198af168c8c7fc30dc18942893c66bb3;hb=6480e936da257519dd36840862ac995ca8c374da;hp=d8c09843ea940903d58d72b36b20d10113089477;hpb=7df269f65639c1a862a58649c48331824029128a;p=ctsim.git diff --git a/src/views.cpp b/src/views.cpp index d8c0984..8203cbc 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.114 2001/02/23 02:06:02 kevin Exp $ +** $Id: views.cpp,v 1.116 2001/02/23 21:58:32 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 @@ -1001,6 +1001,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,7 +2438,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) } else { if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { - ThreadedReconstructor* pReconstructor = new ThreadedReconstructor (this, + ReconstructorSupervisor* pReconstructor = new ReconstructorSupervisor (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()); @@ -2637,6 +2641,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);