r631: no message
[ctsim.git] / src / views.cpp
index 9a2eb3113b23ed9f9f3f6796c9e974a570a7e30c..c9689bfab866a05e6b81b901f2d697b0198d2a07 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.132 2001/03/11 06:34:37 kevin Exp $
+**  $Id: views.cpp,v 1.133 2001/03/11 15:27:30 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
@@ -2459,6 +2459,7 @@ ProjectionFileView::OnConvertParallel (wxCommandEvent& event)
     wxMessageBox ("Projections are already parallel", "Error");
     return;
   }
+  wxProgressDialog dlgProgress (wxString("Convert to Parallel"), wxString("Conversion Progress"), 1, getFrameForChild(), wxPD_APP_MODAL);
   Projections* pProjNew = rProj.interpolateToParallel();
   ProjectionFileDocument* pProjDocNew = theApp->newProjectionDoc();
   pProjDocNew->setProjections (pProjNew);  
@@ -2488,10 +2489,17 @@ ProjectionFileView::OnReconstructFourier (wxCommandEvent& event)
 void
 ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
 {
+  const Projections& rProj = GetDocument()->getProjections();
+  ReconstructionROI defaultROI;
+  defaultROI.m_dXMin = -rProj.phmLen() / 2;
+  defaultROI.m_dXMax = defaultROI.m_dXMin + rProj.phmLen();
+  defaultROI.m_dYMin = -rProj.phmLen() / 2;
+  defaultROI.m_dYMax = defaultROI.m_dYMin + rProj.phmLen();
+
   DialogGetReconstructionParameters dialogReconstruction (getFrameForChild(), m_iDefaultNX, m_iDefaultNY, 
     m_iDefaultFilter, m_dDefaultFilterParam, m_iDefaultFilterMethod, m_iDefaultFilterGeneration, 
     m_iDefaultZeropad, m_iDefaultInterpolation, m_iDefaultInterpParam, m_iDefaultBackprojector, 
-    m_iDefaultTrace);
+    m_iDefaultTrace,  &defaultROI);
   
   int retVal = dialogReconstruction.ShowModal();
   if (retVal != wxID_OK)
@@ -2513,11 +2521,11 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
   wxString optBackprojectName = dialogReconstruction.getBackprojectName();
   m_iDefaultBackprojector = Backprojector::convertBackprojectNameToID (optBackprojectName.c_str());
   m_iDefaultTrace = dialogReconstruction.getTrace();
-  
+  dialogReconstruction.getROI (&defaultROI);
+
   if (m_iDefaultNX <= 0 && m_iDefaultNY <= 0) 
     return;
   
-  const Projections& rProj = GetDocument()->getProjections();
   std::ostringstream os;
   os << "Reconstruct " << rProj.getFilename() << ": xSize=" << m_iDefaultNX << ", ySize=" << m_iDefaultNY << ", Filter=" << optFilterName.c_str() << ", FilterParam=" << m_dDefaultFilterParam << ", FilterMethod=" << optFilterMethodName.c_str() << ", FilterGeneration=" << optFilterGenerationName.c_str() << ", Zeropad=" << m_iDefaultZeropad << ", Interpolation=" << optInterpName.c_str() << ", InterpolationParam=" << m_iDefaultInterpParam << ", Backprojection=" << optBackprojectName.c_str();
   
@@ -2527,7 +2535,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
     pImageFile = new ImageFile (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);
+      optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), m_iDefaultTrace, &defaultROI);
     
     ReconstructDialog* pDlgReconstruct = new ReconstructDialog (*pReconstructor, rProj, *pImageFile, m_iDefaultTrace, getFrameForChild());
     for (int iView = 0; iView < rProj.nView(); iView++) {
@@ -2553,7 +2561,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
       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());
+        optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), os.str().c_str(), &defaultROI);
       if (pReconstructor->Create() != wxTHREAD_NO_ERROR) {
         sys_error (ERR_SEVERE, "Error creating reconstructor thread");
         delete pReconstructor;
@@ -2568,7 +2576,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
       pImageFile = new ImageFile (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);
+        optInterpName.c_str(), m_iDefaultInterpParam, optBackprojectName.c_str(), m_iDefaultTrace, &defaultROI);
       
       wxProgressDialog dlgProgress (wxString("Reconstruction"), wxString("Reconstruction Progress"), rProj.nView() + 1, getFrameForChild(), wxPD_CAN_ABORT );
       for (int iView = 0; iView < rProj.nView(); iView++) {