r598: no message
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 2 Mar 2001 21:11:50 +0000 (21:11 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 2 Mar 2001 21:11:50 +0000 (21:11 +0000)
16 files changed:
INSTALL
doc/ctsim-install.tex
doc/ctsim.prj
msvc/ctsim/ctsim.plg
src/backgroundsupr.cpp
src/backgroundsupr.h
src/ctsim.cpp
src/ctsim.h
src/dialogs.cpp
src/threadproj.cpp
src/threadproj.h
src/threadraster.cpp
src/threadraster.h
src/threadrecon.cpp
src/threadrecon.h
src/views.cpp

diff --git a/INSTALL b/INSTALL
index 265eccec0f2741c8d06443e1abee751ba9f6327f..ca3c6a9ccbd2f44ed6dd4f1b68a0bc58e6cb6c30 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -20,10 +20,8 @@ wxWindows (http://www.wxwindows.org)
   Used by CTSim (src/*) graphic front-end. Platform independent for
   GTK, Motif, and Windows32 API's.
 
-g2 (http://g2.sourceforge.net)
-  Currently, used partially by SGP (Simple Graphics Package) for 
-  graphical display by command-line tools (tools/*). This library
-  will likely be deprecated in favor of wxWindows.
+ctn (http://www.erl.wustl.edu/DICOM/ctn.html)
+  Used by CTSim for DICOM file import and export
 
 lam (http://www.mpi.nd.edu/lam/)
   There is support is MPI clustering. I use this code at home for my
index b0cd92fbb449e5831d98c0bc0428fad5bf1ca2fd..f8b319aabdec43d474ba4ca33ef91fe905909fdc 100644 (file)
@@ -66,4 +66,8 @@ However, they add functionality to \ctsim\ and there inclusion is recommended.
     Used for debugging memory allocation.\\
     \urlref{Web site}{http://www.dmalloc.com}
 
+  \item \textbf{ctn}\\
+    DICOM library used to support import/export of DICOM files
+    \urlref{Web site}{http://www.erl.wustl.edu/DICOM/ctn.html}
+
 \end{itemize}
index e2ee8a5369898d5beeb4025d1c90f2e68b88baa2..e7dbe76c003f7ed0253aab0418e3bb021f45f511 100644 (file)
@@ -5,8 +5,8 @@
 1
 ctsim.tex
 21
+4
 3
-1
 
 
 ctsim-algorithms.tex
@@ -14,19 +14,19 @@ TeX
 4091 0 65 52 0 43 44 44 960 631
 ctsim-concepts.tex
 TeX
-268447738 0 302 40 280 44 110 110 1187 697
+12282 0 302 40 280 44 110 110 1187 697
 ctsim.tex
 TeX
-134230010 2 50 12 50 22 22 22 1099 609
+134230010 0 50 12 33 1 22 22 1099 609
+ctsim-install.tex
+TeX
+268447738 0 70 62 71 1 110 110 1187 697
 tex2rtf.ini
 DATA
 273777330 0 0 1 26 8 22 22 938 609
 ctsim-gui.tex
 TeX
 268447738 0 145 21 144 1 176 176 1253 763
-ctsim-install.tex
-TeX
-268447738 1 0 1 4 1 110 110 1187 697
 psbox.tex
 TeX
 268439546 0 0 1 0 1 88 88 1004 675
index 42b38df4dca15fc45eedfc419bc1760638404c41..ba3cdb4fcb93ab730b0bd1ff2fabe55b2d031e70 100644 (file)
@@ -3,63 +3,30 @@
 <pre>
 <h1>Build Log</h1>
 <h3>
---------------------Configuration: libctsim - Win32 Debug--------------------
+--------------------Configuration: ctsim - Win32 Debug--------------------
 </h3>
 <h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB5.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9D.tmp" with contents
 [
-/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /I "\dicom\ctn\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
-"C:\ctsim\libctsim\ctndicom.cpp"
-"C:\ctsim\libctsim\projections.cpp"
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
+"D:\ctsim\src\backgroundmgr.cpp"
+"D:\ctsim\src\backgroundsupr.cpp"
+"D:\ctsim\src\graph3dview.cpp"
+"D:\ctsim\src\threadproj.cpp"
+"D:\ctsim\src\threadraster.cpp"
+"D:\ctsim\src\threadrecon.cpp"
 ]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB5.tmp" 
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB6.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9D.tmp" 
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9E.tmp" with contents
 [
-/nologo /out:"Debug\libctsim.lib" 
-.\Debug\array2dfile.obj
-.\Debug\backprojectors.obj
-.\Debug\clip.obj
-.\Debug\consoleio.obj
-.\Debug\ctndicom.obj
-.\Debug\dlgezplot.obj
-.\Debug\ezplot.obj
-.\Debug\ezset.obj
-.\Debug\ezsupport.obj
-.\Debug\filter.obj
-.\Debug\fnetorderstream.obj
-.\Debug\fourier.obj
-.\Debug\getopt.obj
-.\Debug\getopt1.obj
-.\Debug\globalvars.obj
-.\Debug\hashtable.obj
-.\Debug\imagefile.obj
-.\Debug\interpolator.obj
-.\Debug\mathfuncs.obj
-.\Debug\phantom.obj
-.\Debug\plotfile.obj
-.\Debug\pol.obj
-.\Debug\procsignal.obj
-.\Debug\projections.obj
-.\Debug\reconstruct.obj
-.\Debug\scanner.obj
-.\Debug\sgp.obj
-.\Debug\strfuncs.obj
-.\Debug\syserror.obj
-.\Debug\trace.obj
-.\Debug\transformmatrix.obj
-.\Debug\xform.obj
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
+"D:\ctsim\src\ctsim.cpp"
+"D:\ctsim\src\dialogs.cpp"
+"D:\ctsim\src\docs.cpp"
+"D:\ctsim\src\views.cpp"
 ]
-Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB6.tmp"
-<h3>Output Window</h3>
-Compiling...
-ctndicom.cpp
-projections.cpp
-Creating library...
-<h3>
---------------------Configuration: ctsim - Win32 Debug--------------------
-</h3>
-<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB7.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9E.tmp" 
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9F.tmp" with contents
 [
 winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib ctn_lib.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib" /libpath:"\dicom\ctn\winctn\ctn_lib\Debug" 
 .\Debug\backgroundmgr.obj
@@ -86,8 +53,20 @@ winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..
 \wx2.2.5\lib\zlibd.lib
 \wx2.2.5\lib\tiffd.lib
 ]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPB7.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPA9F.tmp"
 <h3>Output Window</h3>
+Compiling...
+backgroundsupr.cpp
+threadproj.cpp
+threadraster.cpp
+threadrecon.cpp
+backgroundmgr.cpp
+graph3dview.cpp
+Compiling...
+ctsim.cpp
+dialogs.cpp
+docs.cpp
+views.cpp
 Linking...
 
 
index 3b2f36245f154f46802f3883da355b809ca4f378..09560c4068ef6d8f2d1ecfe52fb7858055e8e46e 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: backgroundsupr.cpp,v 1.9 2001/02/27 03:59:30 kevin Exp $
+**  $Id: backgroundsupr.cpp,v 1.10 2001/03/02 21:11:50 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
 #include "backgroundsupr.h"
 #include "backgroundmgr.h"
 
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
-
+#ifdef HAVE_WXTHREADS
 
 ////////////////////////////////////////////////////////////////////////////
 //
@@ -68,7 +65,7 @@ BackgroundSupervisor::cancelSupervisor (BackgroundSupervisor* pSupervisor)
 
 
 BackgroundSupervisor::BackgroundSupervisor (SupervisorThread* pMyThread, wxFrame* pParentFrame, wxDocument* pDocument, const char* const pszProcessTitle, int iTotalUnits)
-    : m_pMyThread(pMyThread), m_pParentFrame(pParentFrame), m_pDocument(pDocument), m_pDialogProgress(NULL), m_strProcessTitle(pszProcessTitle), 
+    : m_pMyThread(pMyThread), m_pParentFrame(pParentFrame), m_pDocument(pDocument), m_strProcessTitle(pszProcessTitle), 
     m_iTotalUnits(iTotalUnits), m_iNumThreads(0), m_bDone(false), m_bFail(false), m_bCancelled(false), 
     m_pTimer(NULL), m_bBackgroundTaskAdded(false), m_bWorkersDeleted(false),
     wxEvtHandler()
@@ -97,7 +94,6 @@ BackgroundSupervisor::~BackgroundSupervisor()
   }
 
   delete m_pTimer;
-  delete m_pDialogProgress;
 }
 
 void
@@ -149,21 +145,16 @@ BackgroundSupervisor::start()
 
   m_pTimer = new Timer;
   
-  if (! theApp->getUseBackgroundTasks())
-    m_pDialogProgress = new wxProgressDialog (_T("Filtered Backprojection"), _T("Reconstruction Progress"), 
-    m_iTotalUnits, m_pParentFrame, wxPD_CAN_ABORT | wxPD_AUTO_HIDE);
-  else {
-    std::string strLabel (m_strProcessTitle);
-    strLabel += " ";
-    strLabel += m_pParentFrame->GetTitle();
-    wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_ADD);
-    addTaskEvent.SetString (strLabel.c_str());
-    addTaskEvent.SetInt (m_iTotalUnits);
-    addTaskEvent.SetClientData (this);
-    wxPostEvent (theApp->getBackgroundManager(), addTaskEvent);
-    wxPostEvent (m_pDocument, addTaskEvent);
-    m_bBackgroundTaskAdded = true;
-  }
+  std::string strLabel (m_strProcessTitle);
+  strLabel += " ";
+  strLabel += m_pParentFrame->GetTitle();
+  wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_ADD);
+  addTaskEvent.SetString (strLabel.c_str());
+  addTaskEvent.SetInt (m_iTotalUnits);
+  addTaskEvent.SetClientData (this);
+  wxPostEvent (theApp->getBackgroundManager(), addTaskEvent);
+  wxPostEvent (m_pDocument, addTaskEvent);
+  m_bBackgroundTaskAdded = true;
   
   m_iRunning = m_iNumThreads;
   m_iUnitsDone = 0;
@@ -198,17 +189,10 @@ BackgroundSupervisor::OnWorkerUnitTick (wxCommandEvent& event)
       *theApp->getLog() << "Units done: " << static_cast<int>(m_iUnitsDone) <<"\n";
 #endif
     
-    if (m_pDialogProgress) {
-      if (! m_pDialogProgress->Update (m_iUnitsDone - 1)) {
-        wxCommandEvent dummy;
-        OnCancel (dummy);
-      }
-    } else {
-      wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_UNIT_TICK);
-      addTaskEvent.SetInt (m_iUnitsDone - 1);
-      addTaskEvent.SetClientData (this);
-      wxPostEvent (theApp->getBackgroundManager(), addTaskEvent);
-    }
+    wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_UNIT_TICK);
+    addTaskEvent.SetInt (m_iUnitsDone - 1);
+    addTaskEvent.SetClientData (this);
+    wxPostEvent (theApp->getBackgroundManager(), addTaskEvent);
 }
 
 void
@@ -244,3 +228,4 @@ BackgroundSupervisor::OnWorkerFail (wxCommandEvent& event)
   OnCancel(dummy);
 }
 
+#endif // HAVE_WXTHREADS
index b77b99700ced312fcd467bf3a44eac23dd6c7837..3e170b740d4e99f034a9019334da01c4617dcc4f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: backgroundsupr.h,v 1.5 2001/02/26 17:36:56 kevin Exp $
+**  $Id: backgroundsupr.h,v 1.6 2001/03/02 21:11:50 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
@@ -58,8 +58,7 @@ private:
   wxFrame* m_pParentFrame;
   wxDocument* m_pDocument;
   const std::string m_strProcessTitle;
-  wxProgressDialog* m_pDialogProgress;
-
+  
   volatile bool m_bFail;
   std::string m_strFailMessage;
   int m_iNumThreads;
index 3449d480187da0834fe3a3c0f99d7da6c4ada2a3..26a57b33984ada0195523c3cdc9bc73696a54fb5 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: ctsim.cpp,v 1.91 2001/03/02 02:08:14 kevin Exp $
+**  $Id: ctsim.cpp,v 1.92 2001/03/02 21:11:50 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
@@ -69,7 +69,7 @@
 #endif
 #endif
 
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.91 2001/03/02 02:08:14 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.92 2001/03/02 21:11:50 kevin Exp $";
 
 struct option CTSimApp::ctsimOptions[] = 
 {
@@ -453,12 +453,12 @@ MainFrame::MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const
   m_dDefaultFilterOutputScale = 1.;
   m_iDefaultImportFormat = ImageFile::IMPORT_FORMAT_PPM;
   
-  wxAcceleratorEntry accelEntries[16];
+  wxAcceleratorEntry accelEntries[15];
   accelEntries[0].Set (wxACCEL_CTRL, static_cast<int>('O'), wxID_OPEN);
-  accelEntries[2].Set (wxACCEL_CTRL, static_cast<int>('P'), MAINMENU_FILE_CREATE_PHANTOM);
-  accelEntries[3].Set (wxACCEL_CTRL, static_cast<int>('F'), MAINMENU_FILE_CREATE_FILTER);
-  accelEntries[4].Set (wxACCEL_CTRL, static_cast<int>('I'), MAINMENU_IMPORT);
-  accelEntries[5].Set (wxACCEL_NORMAL, WXK_F1, MAINMENU_HELP_CONTENTS);
+  accelEntries[1].Set (wxACCEL_CTRL, static_cast<int>('P'), MAINMENU_FILE_CREATE_PHANTOM);
+  accelEntries[2].Set (wxACCEL_CTRL, static_cast<int>('F'), MAINMENU_FILE_CREATE_FILTER);
+  accelEntries[3].Set (wxACCEL_CTRL, static_cast<int>('I'), MAINMENU_IMPORT);
+  accelEntries[4].Set (wxACCEL_NORMAL, WXK_F1, MAINMENU_HELP_CONTENTS);
 #ifndef CTSIM_MDI
   for (i = 0; i < 10; i++)
     accelEntries[i+5].Set (wxACCEL_CTRL, static_cast<int>('0'+i), MAINMENU_WINDOW_BASE+i);
index e80bbb7c53433f26a780b35845628aeb8ca6b79a..abc16fd173e41c7473195dab2232809421e8b599 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: ctsim.h,v 1.53 2001/03/01 20:02:18 kevin Exp $
+**  $Id: ctsim.h,v 1.54 2001/03/02 21:11:50 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
 #include <dmalloc.h>
 #endif
 
+#ifdef MSVC
+#define HAVE_WXTHREADS 1
+#else
+#undef HAVE_WXTHREADS
+#endif
+
 #ifndef WX_PRECOMP
 #include "wx/wx.h"
 #endif
index 42fe44d8cff8e3006b970550fb7e83bfbbde2740..8ecf945f4e3a8359034255906b55a93afd788904 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: dialogs.cpp,v 1.45 2001/03/01 20:02:18 kevin Exp $
+**  $Id: dialogs.cpp,v 1.46 2001/03/02 21:11:50 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
@@ -244,7 +244,9 @@ DialogPreferences::DialogPreferences (wxWindow* pParent, const char* const pszTi
 
   m_pCBUseBackgroundTasks = new wxCheckBox (this, -1, "Put Tasks in Background", wxDefaultPosition, wxSize(250, 25), 0);
   m_pCBUseBackgroundTasks->SetValue (bUseBackgroundTasks);
+#ifdef HAVE_WXTHREADS
   pTopSizer->Add (m_pCBUseBackgroundTasks, 0, wxALIGN_CENTER_VERTICAL);
+#endif
 
   pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
   
index c4fa9aeabdbad87ae5b86a1c03bc09b4f90abd7c..64216562ab82c04d1c5ec401ee30471db3067313 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadproj.cpp,v 1.6 2001/03/01 07:30:49 kevin Exp $
+**  $Id: threadproj.cpp,v 1.7 2001/03/02 21:11:50 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
 #include "wx/wx.h"
 #endif
 
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
 #include "ct.h"
 #include "ctsim.h"
 #include "docs.h"
@@ -39,9 +43,8 @@
 #include "backgroundmgr.h"
 #include "backgroundsupr.h"
 
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
+#ifdef HAVE_WXTHREADS
+
 
 
 
@@ -150,16 +153,15 @@ ProjectorSupervisor::onDone()
   wxCriticalSection doneSection;
   wxCriticalSectionLocker critsect (doneSection);
 
+  Projections* pProjections = getProjections();
+
+  wxMutexGuiEnter();
   ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc();
   if (! pProjDoc) {
     sys_error (ERR_SEVERE, "Unable to create projection file");
     return;
-  }
-    
-  Projections* pProjections = getProjections();
+  }  
   pProjDoc->setProjections (pProjections);
-  if (theApp->getAskDeleteNewDocs())
-    pProjDoc->Modify (true);
   pProjDoc->UpdateAllViews (NULL);
   if (ProjectionFileView* projView = pProjDoc->getView()) {
     projView->OnUpdate (projView, NULL);
@@ -167,6 +169,10 @@ ProjectorSupervisor::onDone()
     projView->getFrame()->Show(true);
   }
   *theApp->getLog() << m_pszLabel << "\n";
+  wxMutexGuiLeave();
+
+  if (theApp->getAskDeleteNewDocs())
+    pProjDoc->Modify (true);
   pProjections->setRemark (m_pszLabel);
   pProjections->setCalcTime (getTimerEnd());
 
@@ -274,3 +280,5 @@ void
 ProjectorWorker::OnExit ()
 {
 }
+
+#endif // HAVE_WXTHREADS
index 80ac09efe9cd9c7a7572176877f00e573a909388..f76339e475746a637909284efd5ac51549bf1a6f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadproj.h,v 1.4 2001/03/01 07:30:49 kevin Exp $
+**  $Id: threadproj.h,v 1.5 2001/03/02 21:11:50 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
@@ -28,6 +28,8 @@
 #ifndef _THREADPROJ_H
 #define _THREADPROJ_H
 
+#ifdef HAVE_WXTHREADS
+
 #include <vector>
 #include <wx/thread.h>
 #include <wx/progdlg.h>
@@ -137,5 +139,6 @@ public:
 };
 
 
-#endif
+#endif // HAVE_WXTHREADS
+#endif // _THREADPROJ_H_
   
index 00f89dc103c670901ba203ac60c9b97965407f1a..252d6c592e9026d3bf98d8b6a2a3dbf5d2c7ce94 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadraster.cpp,v 1.1 2001/02/27 03:59:30 kevin Exp $
+**  $Id: threadraster.cpp,v 1.2 2001/03/02 21:11:50 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
 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ******************************************************************************/
 
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
 #include "wx/wxprec.h"
 
 #ifndef WX_PRECOMP
 #include "ctsim.h"
 #include "docs.h"
 #include "views.h"
+
+
+#ifdef HAVE_WXTHREADS
+
+
 #include "threadraster.h"
 #include "backgroundmgr.h"
 #include "backgroundsupr.h"
 
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
-
-
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -135,16 +140,15 @@ RasterizerSupervisor::onDone()
   wxCriticalSection doneSection;
   wxCriticalSectionLocker critsect (doneSection);
 
+  ImageFile* pImageFile = getImageFile();
+
+  wxMutexGuiEnter();
   ImageFileDocument* pImageDoc = theApp->newImageDoc();
   if (! pImageDoc) {
     sys_error (ERR_SEVERE, "Unable to create image file");
     return;
-  }
-    
-  ImageFile* pImageFile = getImageFile();
+  }  
   pImageDoc->setImageFile (pImageFile);
-  if (theApp->getAskDeleteNewDocs())
-    pImageDoc->Modify (true);
   pImageDoc->UpdateAllViews (NULL);
   if (ImageFileView* imageView = pImageDoc->getView()) {
     imageView->OnUpdate (imageView, NULL);
@@ -152,7 +156,10 @@ RasterizerSupervisor::onDone()
     imageView->getFrame()->Show(true);
   }
   *theApp->getLog() << m_pszLabel << "\n";
+  wxMutexGuiLeave();
   pImageFile->labelAdd (m_pszLabel, getTimerEnd());
+  if (theApp->getAskDeleteNewDocs())
+    pImageDoc->Modify (true);
 
   setDone();
 }
@@ -230,3 +237,5 @@ void
 RasterizerWorker::OnExit ()
 {
 }
+
+#endif // HAVE_WXTHREADS
index b161c03abb84dfe57279e279af6e8f932e424eb7..2644a45840cdb9fe72e6ebb254ea295755040764 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadraster.h,v 1.1 2001/02/27 03:59:30 kevin Exp $
+**  $Id: threadraster.h,v 1.2 2001/03/02 21:11:50 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
@@ -28,6 +28,8 @@
 #ifndef _THREADRASTER_H
 #define _THREADRASTER_H
 
+#ifdef HAVE_WXTHREADS
+
 #include <vector>
 #include <wx/thread.h>
 #include <wx/progdlg.h>
@@ -114,6 +116,6 @@ public:
   virtual void OnExit();
 };
 
-
-#endif
+#endif // HAVE_WXTHREADS
+#endif // _THREADRASTER_H_
   
index 2cd9dd1bda33475e1bbe711cb119d952d58440b6..c075fb426118ba04081c9bdaa4e95b82d99b4419 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadrecon.cpp,v 1.14 2001/02/27 03:59:30 kevin Exp $
+**  $Id: threadrecon.cpp,v 1.15 2001/03/02 21:11:50 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
@@ -25,6 +25,7 @@
 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ******************************************************************************/
 
+
 #include "wx/wxprec.h"
 
 #ifndef WX_PRECOMP
@@ -39,9 +40,8 @@
 #include "backgroundmgr.h"
 #include "backgroundsupr.h"
 
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
+#ifdef HAVE_WXTHREADS
+
 
 
 
@@ -147,16 +147,15 @@ ReconstructorSupervisor::onDone()
   wxCriticalSection doneSection;
   wxCriticalSectionLocker critsect (doneSection);
 
+  ImageFile* pImageFile = getImageFile();
+
+  wxMutexGuiEnter();
   ImageFileDocument* pReconDoc = theApp->newImageDoc();
   if (! pReconDoc) {
     sys_error (ERR_SEVERE, "Unable to create image file");
     return;
-  }
-    
-  ImageFile* pImageFile = getImageFile();
+  }  
   pReconDoc->setImageFile (pImageFile);
-  if (theApp->getAskDeleteNewDocs())
-    pReconDoc->Modify (true);
   pReconDoc->UpdateAllViews (m_pProjView);
   if (ImageFileView* rasterView = pReconDoc->getView()) {
     rasterView->OnUpdate (rasterView, NULL);
@@ -164,6 +163,10 @@ ReconstructorSupervisor::onDone()
     rasterView->getFrame()->Show(true);
   }
   *theApp->getLog() << m_pszLabel << "\n";
+  wxMutexGuiLeave();
+
+  if (theApp->getAskDeleteNewDocs())
+    pReconDoc->Modify (true);
   pImageFile->labelAdd (m_pProjView->GetDocument()->getProjections().getLabel());
   pImageFile->labelAdd (m_pszLabel, getTimerEnd());
 
@@ -274,3 +277,5 @@ void
 ReconstructorWorker::OnExit ()
 {
 }
+
+#endif // HAVE_WXTHREADS
index 97b36f42238a51720e2d4020191f597c90a21451..f8d2940ee53483fc54da73dc3b12edc0386cc0a0 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadrecon.h,v 1.10 2001/02/25 19:24:01 kevin Exp $
+**  $Id: threadrecon.h,v 1.11 2001/03/02 21:11:50 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
@@ -28,6 +28,9 @@
 #ifndef _THREADRECON_H
 #define _THREADRECON_H
 
+#ifdef HAVE_WXTHREADS
+
+
 #include <vector>
 #include <wx/thread.h>
 #include <wx/progdlg.h>
@@ -135,6 +138,6 @@ public:
   virtual void OnExit();
 };
 
-
-#endif
+#endif // HAVE_WXTHREADS
+#endif // _THREADRECON_H_
   
index b78442190c44e0f06aeade515d24e9dd9fd30369..5a802c459aecb011e94b9c8fb33a1043f16c8ce9 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.124 2001/03/02 20:20:09 kevin Exp $
+**  $Id: views.cpp,v 1.125 2001/03/02 21:11:50 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
@@ -1948,6 +1948,7 @@ PhantomFileView::OnProjections (wxCommandEvent& event)
       }
     }
   } else {
+#if HAVE_WXTHREADS
     if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) {
       ProjectorSupervisorThread* pProjector = new ProjectorSupervisorThread (this, m_iDefaultNDet,
         m_iDefaultNView, sGeometry.c_str(), m_iDefaultNSample, dRotationRadians,
@@ -1960,7 +1961,9 @@ PhantomFileView::OnProjections (wxCommandEvent& event)
       pProjector->SetPriority(60);
       pProjector->Run();
       return;
-    } else {
+    } else     
+#endif // HAVE_WXTHREADS
+       {
       pProj = new Projections;
       pProj->initFromScanner (theScanner);
       wxProgressDialog dlgProgress (wxString("Projection"), wxString("Projection Progress"), pProj->nView() + 1, getFrameForChild(), wxPD_CAN_ABORT );
@@ -2028,6 +2031,7 @@ PhantomFileView::OnRasterize (wxCommandEvent& event)
     << m_iDefaultRasterNY << ", ViewRatio=" << m_dDefaultRasterViewRatio << ", nSamples=" 
     << m_iDefaultRasterNSamples;;
 
+#if HAVE_WXTHREADS
   if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) {
     RasterizerSupervisorThread* pThread = new RasterizerSupervisorThread (this, m_iDefaultRasterNX, m_iDefaultRasterNY,
       m_iDefaultRasterNSamples, m_dDefaultRasterViewRatio, os.str().c_str());
@@ -2037,7 +2041,9 @@ PhantomFileView::OnRasterize (wxCommandEvent& event)
     }
     pThread->SetPriority (60);
     pThread->Run();
-  } else {
+  } else 
+#endif
+  {
     ImageFile* pImageFile = new ImageFile (m_iDefaultRasterNX, m_iDefaultRasterNY);
     wxProgressDialog dlgProgress (wxString("Rasterize"), wxString("Rasterization Progress"), 
       pImageFile->nx() + 1, getFrameForChild(), wxPD_CAN_ABORT );
@@ -2465,6 +2471,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
     delete pDlgReconstruct;
     delete pReconstructor;
   } else {
+#if HAVE_WXTHREADS
     if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) {
       ReconstructorSupervisorThread* pReconstructor = new ReconstructorSupervisorThread (this, 
         m_iDefaultNX, m_iDefaultNY, optFilterName.c_str(), 
@@ -2478,7 +2485,9 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event)
       pReconstructor->SetPriority (60);
       pReconstructor->Run();
       return;
-    } else {
+    } else 
+#endif
+       {
       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(),