r557: no message
[ctsim.git] / src / views.cpp
index 8721cd4cd886b0f854dc22454cccd424261949cc..557bc2f2ef79b548bc2ed47f8b7256d8091f4e88 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.107 2001/02/19 20:23:17 kevin Exp $
+**  $Id: views.cpp,v 1.108 2001/02/20 04:48:45 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
@@ -1901,7 +1901,7 @@ PhantomFileView::OnProjections (wxCommandEvent& event)
         return;
       }
       pProj->initFromScanner (theScanner);
-      m_dDefaultRotation /= PI;  // convert back to PI units
+      m_dDefaultRotation /= TWOPI;  // convert back to fraction of a circle
       
       Timer timer;
       if (m_iDefaultTrace > Trace::TRACE_CONSOLE) {
@@ -2371,26 +2371,29 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
     wxString optBackprojectName = dialogReconstruction.getBackprojectName();
     m_iDefaultBackprojector = Backprojector::convertBackprojectNameToID (optBackprojectName.c_str());
     m_iDefaultTrace = dialogReconstruction.getTrace();
+
     if (m_iDefaultNX > 0 && m_iDefaultNY > 0) {
       const Projections& rProj = GetDocument()->getProjections();
-
       ImageFile* pImageFile = new ImageFile;
       pImageFile->setArraySize (m_iDefaultNX, m_iDefaultNY);
       
-      Reconstructor* pReconstructor = new Reconstructor (rProj, *pImageFile, optFilterName.c_str(), m_dDefaultFilterParam, optFilterMethodName.c_str(), m_iDefaultZeropad, optFilterGenerationName.c_str(), optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), m_iDefaultTrace);
+      Reconstructor* pReconstructor = new Reconstructor (rProj, *pImageFile, optFilterName.c_str(), 
+        m_dDefaultFilterParam, optFilterMethodName.c_str(), m_iDefaultZeropad, optFilterGenerationName.c_str(), 
+        optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), m_iDefaultTrace);
       
       Timer timerRecon;
       if (m_iDefaultTrace > Trace::TRACE_CONSOLE) {
         ReconstructDialog* pDlgReconstruct = new ReconstructDialog (*pReconstructor, rProj, *pImageFile, m_iDefaultTrace, getFrameForChild());
         for (int iView = 0; iView < rProj.nView(); iView++) {
           ::wxYield();
-          if (pDlgReconstruct->isCancelled() || ! pDlgReconstruct->reconstructView (iView)) {
+          if (pDlgReconstruct->isCancelled() || ! pDlgReconstruct->reconstructView (iView, true)) {
             delete pDlgReconstruct;
             delete pReconstructor;
             delete pImageFile;
             return;
           }
           ::wxYield();
+          ::wxYield();
           while (pDlgReconstruct->isPaused()) {
             ::wxYield();
             ::wxUsleep(50);
@@ -2399,9 +2402,9 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
         delete pDlgReconstruct;
       } else {
         wxProgressDialog dlgProgress (wxString("Reconstruction"), wxString("Reconstruction Progress"), rProj.nView() + 1, getFrameForChild(), wxPD_CAN_ABORT);
-        for (int i = 0; i < rProj.nView(); i++) {
-          pReconstructor->reconstructView (i, 1);
-          if (! dlgProgress.Update (i + 1)) {
+        for (int iView = 0; iView < rProj.nView(); iView++) {
+          pReconstructor->reconstructView (iView, 1);
+          if (! dlgProgress.Update (iView + 1)) {
             delete pReconstructor;
             delete pImageFile;
             return;