** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: backprojectors.h,v 1.21 2001/02/11 04:56:37 kevin Exp $
+** $Id: backprojectors.h,v 1.22 2001/02/22 18:22:40 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
const std::string& failMessage() const {return m_failMessage;}
static const int getBackprojectCount() {return s_iBackprojectCount;}
- static const char** getBackprojectNameArray() {return s_aszBackprojectName;}
- static const char** getBackprojectTitleArray() {return s_aszBackprojectTitle;}
+ static const char* const* getBackprojectNameArray() {return s_aszBackprojectName;}
+ static const char* const* getBackprojectTitleArray() {return s_aszBackprojectTitle;}
static int convertBackprojectNameToID (const char* const bprojName);
static const char* convertBackprojectIDToName (const int bprojID);
static const char* convertBackprojectIDToTitle (const int bprojID);
static const int getInterpCount() {return s_iInterpCount;}
- static const char** getInterpNameArray() {return s_aszInterpName;}
- static const char** getInterpTitleArray() {return s_aszInterpTitle;}
+ static const char* const * getInterpNameArray() {return s_aszInterpName;}
+ static const char* const * getInterpTitleArray() {return s_aszInterpTitle;}
static int convertInterpNameToID (const char* const interpName);
static const char* convertInterpIDToName (const int interpID);
static const char* convertInterpIDToTitle (const int interpID);
bool m_fail;
std::string m_failMessage;
- static const char* s_aszBackprojectName[];
- static const char* s_aszBackprojectTitle[];
+ static const char* const s_aszBackprojectName[];
+ static const char* const s_aszBackprojectTitle[];
static const int s_iBackprojectCount;
- static const char* s_aszInterpName[];
- static const char* s_aszInterpTitle[];
+ static const char* const s_aszInterpName[];
+ static const char* const s_aszInterpTitle[];
static const int s_iInterpCount;
bool initBackprojector (const Projections& proj, ImageFile& im, const char* const backprojName, const char* const interpName, const int interpFactor);
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: filter.h,v 1.26 2001/02/16 00:28:41 kevin Exp $
+** $Id: filter.h,v 1.27 2001/02/22 18:22:40 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
static const int getFilterCount() {return s_iFilterCount;}
static const int getReconstructFilterCount() { return s_iReconstructFilterCount; }
- static const char** getFilterNameArray() {return s_aszFilterName;}
- static const char** getFilterTitleArray() {return s_aszFilterTitle;}
+ static const char* const* getFilterNameArray() {return s_aszFilterName;}
+ static const char* const* getFilterTitleArray() {return s_aszFilterTitle;}
static int convertFilterNameToID (const char* const filterName);
static const char* convertFilterIDToName (const int idFilter);
static const char* convertFilterIDToTitle (const int idFilter);
static const int getDomainCount() {return s_iDomainCount;}
- static const char** getDomainNameArray() {return s_aszDomainName;}
- static const char** getDomainTitleArray() {return s_aszDomainTitle;}
+ static const char* const* getDomainNameArray() {return s_aszDomainName;}
+ static const char* const* getDomainTitleArray() {return s_aszDomainTitle;}
static int convertDomainNameToID (const char* const domainName);
static const char* convertDomainIDToName (const int idDomain);
static const char* convertDomainIDToTitle (const int idDomain);
bool m_fail;
std::string m_failMessage;
- static const char* s_aszFilterName[];
- static const char* s_aszFilterTitle[];
+ static const char* const s_aszFilterName[];
+ static const char* const s_aszFilterTitle[];
static const int s_iFilterCount;
static const int s_iReconstructFilterCount;
- static const char* s_aszDomainName[];
- static const char* s_aszDomainTitle[];
+ static const char* const s_aszDomainName[];
+ static const char* const s_aszDomainTitle[];
static const int s_iDomainCount;
static int N_INTEGRAL;
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: procsignal.h,v 1.13 2001/01/28 19:10:18 kevin Exp $
+** $Id: procsignal.h,v 1.14 2001/02/22 18:22:40 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
const int idFilterGeneration() const { return m_idFilterGeneration;}
static const int getFilterGenerationCount() {return s_iFilterGenerationCount;}
- static const char** getFilterGenerationNameArray() {return s_aszFilterGenerationName;}
- static const char** getFilterGenerationTitleArray() {return s_aszFilterGenerationTitle;}
+ static const char* const* getFilterGenerationNameArray() {return s_aszFilterGenerationName;}
+ static const char* const* getFilterGenerationTitleArray() {return s_aszFilterGenerationTitle;}
static int convertFilterGenerationNameToID (const char* const fgName);
static const char* convertFilterGenerationIDToName (const int idFG);
static const char* convertFilterGenerationIDToTitle (const int idFG);
static const int getFilterMethodCount() {return s_iFilterMethodCount;}
- static const char** getFilterMethodNameArray() {return s_aszFilterMethodName;}
- static const char** getFilterMethodTitleArray() {return s_aszFilterMethodTitle;}
+ static const char* const* getFilterMethodNameArray() {return s_aszFilterMethodName;}
+ static const char* const* getFilterMethodTitleArray() {return s_aszFilterMethodTitle;}
static int convertFilterMethodNameToID (const char* const filterMethodName);
static const char* convertFilterMethodIDToName (const int idFilterMethod);
static const char* convertFilterMethodIDToTitle (const int idFilterMethod);
bool m_fail;
std::string m_failMessage;
- static const char* s_aszFilterMethodName[];
- static const char* s_aszFilterMethodTitle[];
+ static const char* const s_aszFilterMethodName[];
+ static const char* const s_aszFilterMethodTitle[];
static const int s_iFilterMethodCount;
- static const char* s_aszFilterGenerationName[];
- static const char* s_aszFilterGenerationTitle[];
+ static const char* const s_aszFilterGenerationName[];
+ static const char* const s_aszFilterGenerationTitle[];
static const int s_iFilterGenerationCount;
#ifdef HAVE_FFTW
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.h,v 1.24 2001/02/20 17:44:14 kevin Exp $
+** $Id: projections.h,v 1.25 2001/02/22 18:22:40 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
~Projections ();
static const int getInterpCount() {return s_iInterpCount;}
- static const char** getInterpNameArray() {return s_aszInterpName;}
- static const char** getInterpTitleArray() {return s_aszInterpTitle;}
+ static const char* const* getInterpNameArray() {return s_aszInterpName;}
+ static const char* const* getInterpTitleArray() {return s_aszInterpTitle;}
static int convertInterpNameToID (const char* const interpName);
static const char* convertInterpIDToName (const int interpID);
static const char* convertInterpIDToTitle (const int interpID);
const static kuint16 m_signature;
- static const char* s_aszInterpName[];
- static const char* s_aszInterpTitle[];
+ static const char* const s_aszInterpName[];
+ static const char* const s_aszInterpTitle[];
static const int s_iInterpCount;
bool headerWrite (fnetorderstream& fs);
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: backprojectors.cpp,v 1.26 2001/02/11 04:56:37 kevin Exp $
+** $Id: backprojectors.cpp,v 1.27 2001/02/22 18:22:40 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
const int Backprojector::BPROJ_DIFF = 2;
const int Backprojector::BPROJ_IDIFF = 3;
-const char* Backprojector::s_aszBackprojectName[] =
+const char* const Backprojector::s_aszBackprojectName[] =
{
{"trig"},
{"table"},
{"idiff"},
};
-const char* Backprojector::s_aszBackprojectTitle[] =
+const char* const Backprojector::s_aszBackprojectTitle[] =
{
{"Direct Trigometric"},
{"Trigometric Table"},
const int Backprojector::INTERP_3BSPLINE = 7;
#endif
-const char* Backprojector::s_aszInterpName[] =
+const char* const Backprojector::s_aszInterpName[] =
{
{"nearest"},
{"linear"},
#endif
};
-const char* Backprojector::s_aszInterpTitle[] =
+const char* const Backprojector::s_aszInterpTitle[] =
{
{"Nearest"},
{"Linear"},
** This is part of the CTSim program
** Copyright (c) 1983-2000 Kevin Rosenberg
**
-** $Id: filter.cpp,v 1.37 2001/02/16 00:28:41 kevin Exp $
+** $Id: filter.cpp,v 1.38 2001/02/22 18:22:40 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
const int SignalFilter::s_iReconstructFilterCount = 4;
-const char* SignalFilter::s_aszFilterName[] = {
+const char* const SignalFilter::s_aszFilterName[] = {
{"abs_bandlimit"},
{"abs_hamming"},
{"abs_hanning"},
{"triangle"},
};
-const char* SignalFilter::s_aszFilterTitle[] = {
+const char* const SignalFilter::s_aszFilterTitle[] = {
{"Abs(w) * Bandlimit"},
{"Abs(w) * Hamming"},
{"Abs(w) * Hanning"},
const int SignalFilter::DOMAIN_FREQUENCY = 0;
const int SignalFilter::DOMAIN_SPATIAL = 1;
-const char* SignalFilter::s_aszDomainName[] = {
+const char* const SignalFilter::s_aszDomainName[] = {
{"frequency"},
{"spatial"},
};
-const char* SignalFilter::s_aszDomainTitle[] = {
+const char* const SignalFilter::s_aszDomainTitle[] = {
{"Frequency"},
{"Spatial"},
};
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: procsignal.cpp,v 1.25 2001/02/11 04:56:37 kevin Exp $
+** $Id: procsignal.cpp,v 1.26 2001/02/22 18:22:40 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
const int ProcessSignal::FILTER_METHOD_FFTW = 4;
const int ProcessSignal::FILTER_METHOD_RFFTW =5 ;
#endif
-const char* ProcessSignal::s_aszFilterMethodName[] = {
+const char* const ProcessSignal::s_aszFilterMethodName[] = {
{"convolution"},
{"fourier"},
{"fouier-table"},
{"rfftw"},
#endif
};
-const char* ProcessSignal::s_aszFilterMethodTitle[] = {
+const char* const ProcessSignal::s_aszFilterMethodTitle[] = {
{"Convolution"},
{"Fourier"},
{"Fouier Trigometric Table"},
const int ProcessSignal::FILTER_GENERATION_INVALID = -1;
const int ProcessSignal::FILTER_GENERATION_DIRECT = 0;
const int ProcessSignal::FILTER_GENERATION_INVERSE_FOURIER = 1;
-const char* ProcessSignal::s_aszFilterGenerationName[] = {
+const char* const ProcessSignal::s_aszFilterGenerationName[] = {
{"direct"},
{"inverse-fourier"},
};
-const char* ProcessSignal::s_aszFilterGenerationTitle[] = {
+const char* const ProcessSignal::s_aszFilterGenerationTitle[] = {
{"Direct"},
{"Inverse Fourier"},
};
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.48 2001/02/20 17:44:14 kevin Exp $
+** $Id: projections.cpp,v 1.49 2001/02/22 18:22:40 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
const int Projections::POLAR_INTERP_BILINEAR = 1;
const int Projections::POLAR_INTERP_BICUBIC = 2;
-const char* Projections::s_aszInterpName[] =
+const char* const Projections::s_aszInterpName[] =
{
{"nearest"},
{"bilinear"},
// {"bicubic"},
};
-const char* Projections::s_aszInterpTitle[] =
+const char* const Projections::s_aszInterpTitle[] =
{
{"Nearest"},
{"Bilinear"},
###############################################################################
+Project: "ThreadVC"=..\..\wx2.2.5\samples\thread\ThreadVC.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "ctsim"=.\ctsim\ctsim.dsp - Package Owner=<4>
Package=<5>
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
+SOURCE=..\..\src\backgroundmgr.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\..\src\ctsim.cpp
# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# End Source File
# End Source File
# Begin Source File
+SOURCE=..\..\src\threadrecon.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\tips.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\..\src\views.cpp
# ADD CPP /D CTSIMVERSION=\"3.0.0alpha5\"
# End Source File
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
+SOURCE=..\..\src\backgroundmgr.h
+# End Source File
+# Begin Source File
+
SOURCE="..\..\src\ctsim-map.h"
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\..\src\threadrecon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\tips.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\src\views.h
# End Source File
# End Group
<pre>
<h1>Build Log</h1>
<h3>
---------------------Configuration: libctsim - Win32 Debug--------------------
-</h3>
-<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75C.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" /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 /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\ctsim\libctgraphics\dlgezplot.cpp"
-"C:\ctsim\libctsim\globalvars.cpp"
-"C:\ctsim\libctsupport\syserror.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75C.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75D.tmp" with contents
-[
-/nologo /out:"Debug\libctsim.lib"
-.\Debug\array2dfile.obj
-.\Debug\backprojectors.obj
-.\Debug\clip.obj
-.\Debug\consoleio.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
-]
-Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75D.tmp"
-<h3>Output Window</h3>
-Compiling...
-dlgezplot.cpp
-Skipping... (no relevant changes detected)
-globalvars.cpp
-syserror.cpp
-Creating library...
-<h3>
--------------------Configuration: ctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75E.tmp" with contents
-[
-/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" /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.0.4\" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\ctsim\src\ctsim.cpp"
-"C:\ctsim\src\dialogs.cpp"
-"C:\ctsim\src\docs.cpp"
-"C:\ctsim\src\views.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75E.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75F.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP84D.tmp" with contents
[
/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" /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.0.4\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\ctsim\src\graph3dview.cpp"
+"C:\ctsim\src\backgroundmgr.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP75F.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP760.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP84D.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP84E.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 /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib"
.\Debug\ctsim.obj
\wx2.2.5\lib\zlibd.lib
\wx2.2.5\lib\tiffd.lib
]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP760.tmp"
-<h3>Output Window</h3>
-Compiling...
-ctsim.cpp
-dialogs.cpp
-docs.cpp
-views.cpp
-Compiling...
-graph3dview.cpp
-Linking...
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP763.tmp" with contents
-[
-/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" /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.0.4\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\ctsim\src\backgroundmgr.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP763.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP84E.tmp"
<h3>Output Window</h3>
Compiling...
backgroundmgr.cpp
+Linking...
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: backgroundmgr.cpp,v 1.1 2001/02/22 15:00:20 kevin Exp $
+** $Id: backgroundmgr.cpp,v 1.2 2001/02/22 18:22:40 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
m_pCanvas = new BackgroundManagerCanvas (this);
theApp->setIconForFrame (this);
- Show(true);
- // if (m_iNumTasks == 0)
- // Show(false);
+ Show(false);
}
wxGauge*
-BackgroundManager::addTask (BackgroundTask* pTask, int iNumUnits)
+BackgroundManager::addTask (BackgroundTask* pTask, int iNumUnits, const char* const pszTaskName)
{
+ wxCriticalSectionLocker locker (m_criticalSection);
+ int iNumTasks = m_vecpBackgroundTasks.size();
+ int iTaskHeight = 20;
wxSize size (50, 10);
- wxPoint pos (4, 5);
+ wxPoint pos (4, 5 + iNumTasks * iTaskHeight);
wxGauge* pGauge = new wxGauge (m_pCanvas, -1, iNumUnits, pos, size);
m_vecpBackgroundTasks.push_back (pTask);
+ m_vecpGauges.push_back (pGauge);
+ m_vecpNames.push_back (new std::string (pszTaskName));
m_iNumTasks++;
+
+ Show(true);
return (pGauge);
}
void
BackgroundManager::taskDone (BackgroundTask* pTask)
{
- m_iNumTasks--;
+ wxCriticalSection doneSection;
+ doneSection.Enter();
+
+ StringContainer::iterator iName = m_vecpNames.begin();
+ GaugeContainer::iterator iGauge = m_vecpGauges.begin();
+ for (TaskContainer::iterator iTask = m_vecpBackgroundTasks.begin(); iTask != m_vecpBackgroundTasks.end(); iTask++) {
+ if (*iTask == pTask) {
+ delete *iName;
+ delete *iGauge;
+ m_vecpBackgroundTasks.erase (iTask);
+ m_vecpGauges.erase (iGauge);
+ m_vecpNames.erase (iName);
+ m_iNumTasks--;
+ break;
+ }
+ iTask++;
+ iGauge++;
+ }
+
+ doneSection.Leave();
+ if (m_iNumTasks <= 0)
+ Show(false);
+ m_pCanvas->Refresh();
+ // delete pTask;
}
bool
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: backgroundmgr.h,v 1.1 2001/02/22 15:00:20 kevin Exp $
+** $Id: backgroundmgr.h,v 1.2 2001/02/22 18:22:40 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
private:
DECLARE_DYNAMIC_CLASS(BackgroundManager)
+ wxCriticalSection m_criticalSection;
BackgroundManagerCanvas* m_pCanvas;
int m_iNumTasks;
- std::vector<BackgroundTask*> m_vecpBackgroundTasks;
- std::vector<wxGauge*> m_vecpGauges;
+
+ typedef std::vector<BackgroundTask*> TaskContainer;
+ typedef std::vector<wxGauge*> GaugeContainer;
+ typedef std::vector<std::string*> StringContainer;
+ TaskContainer m_vecpBackgroundTasks;
+ GaugeContainer m_vecpGauges;
+ StringContainer m_vecpNames;
void OnCloseWindow(wxCloseEvent& event);
public:
BackgroundManager ();
- wxGauge* addTask (BackgroundTask* pTask, int iNumUnits);
+ wxGauge* addTask (BackgroundTask* pTask, int iNumUnits, const char* const pszTaskName);
void taskDone (BackgroundTask* pTask);
bool isCancelling (BackgroundTask* pTask);
+ TaskContainer& getTasks() { return m_vecpBackgroundTasks;}
+ GaugeContainer& getGauges() { return m_vecpGauges;}
+ StringContainer& getNames() { return m_vecpNames;}
+
DECLARE_EVENT_TABLE()
};
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: dialogs.cpp,v 1.41 2001/02/22 15:00:20 kevin Exp $
+** $Id: dialogs.cpp,v 1.42 2001/02/22 18:22:40 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
// StringValueAndTitleListBox
///////////////////////////////////////////////////////////////////////
-StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[])
+StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* const aszTitle[], const char* const aszValue[])
: wxListBox ()
{
wxString* psTitle = new wxString [nChoices];
return m_ppszValues[GetSelection()];
}
-StringValueAndTitleRadioBox::StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* aszTitle[], const char* aszValue[])
+StringValueAndTitleRadioBox::StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* const aszTitle[], const char* const aszValue[])
: wxRadioBox ()
{
wxString* psTitle = new wxString [nChoices];
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: dialogs.h,v 1.30 2001/02/22 15:00:20 kevin Exp $
+** $Id: dialogs.h,v 1.31 2001/02/22 18:22:40 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
class StringValueAndTitleListBox : public wxListBox
{
public:
- StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]);
+ StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* const aszTitle[], const char* const aszValue[]);
const char* getSelectionStringValue () const;
private:
- const char** m_ppszValues;
+ const char* const* m_ppszValues;
};
class StringValueAndTitleRadioBox : public wxRadioBox
{
public:
- StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* aszTitle[], const char* aszValue[]);
+ StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* const aszTitle[], const char* const aszValue[]);
const char* getSelectionStringValue () const;
private:
- const char** m_ppszValues;
+ const char* const* m_ppszValues;
};
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: threadrecon.cpp,v 1.2 2001/02/22 15:00:20 kevin Exp $
+** $Id: threadrecon.cpp,v 1.3 2001/02/22 18:22:40 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
enum {
RTHREAD_UNIT_COMPLETE = -1,
- RTHREAD_THREAD_DONE = -2,
- RTHREAD_THREAD_CANCELLED = -3,
+ RTHREAD_THREAD_DONE = -2,
+ RTHREAD_THREAD_CANCELLED = -3,
};
ThreadedReconstructor::ThreadedReconstructor (ProjectionFileView* pProjView,
- int iImageNX, int iImageNY, const char* pszFilterName, double dFilterParam, const char* pszFilterMethod,
- int iZeropad, const char* pszFilterGenerationName, const char* pszInterpName, int iInterpParam,
- const char* pszBackprojectName, const char* const pszLabel)
- : m_pProjView(pProjView), m_pDialogProgress(NULL), m_pGauge(NULL), m_bFail(false), m_iNumThreads(0), m_iImageNX(iImageNX),
- m_iImageNY(iImageNY), m_strLabel(pszLabel), m_pTimer(NULL), m_bCancelled(false), m_bCancelling(false),
- m_bDone(false), BackgroundTask()
+ int iImageNX, int iImageNY, const char* pszFilterName, double dFilterParam, const char* pszFilterMethod,
+ int iZeropad, const char* pszFilterGenerationName, const char* pszInterpName, int iInterpParam,
+ const char* pszBackprojectName, const char* const pszLabel)
+ : m_pProjView(pProjView), m_pDialogProgress(NULL), m_pGauge(NULL), m_bFail(false), m_iNumThreads(0), m_iImageNX(iImageNX),
+ m_iImageNY(iImageNY), m_strLabel(pszLabel), m_pTimer(NULL), m_bCancelled(false), m_bCancelling(false),
+ BackgroundTask()
{
m_iNumThreads = theApp->getNumberCPU();
-// ++m_iNumThreads;
+ // ++m_iNumThreads;
m_iTotalViews = m_pProjView->GetDocument()->getProjections().nView();
int iBaseViews = m_iTotalViews / m_iNumThreads;
int iExtraViews = m_iTotalViews % m_iNumThreads;
-
+
m_vecpChildImageFile.reserve (m_iNumThreads);
m_vecpReconstructor.reserve (m_iNumThreads);
m_vecpThread.reserve (m_iNumThreads);
-
+
for (unsigned int iProc = 0; iProc < m_iNumThreads; iProc++) {
m_vecpChildImageFile[iProc] = new ImageFile (iImageNX, iImageNY);
m_vecpReconstructor[iProc] = new Reconstructor (m_pProjView->GetDocument()->getProjections(), *m_vecpChildImageFile[iProc],
- pszFilterName, dFilterParam, pszFilterMethod, iZeropad, pszFilterGenerationName,
- pszInterpName, iInterpParam, pszBackprojectName, Trace::TRACE_NONE);
-
+ pszFilterName, dFilterParam, pszFilterMethod, iZeropad, pszFilterGenerationName,
+ pszInterpName, iInterpParam, pszBackprojectName, Trace::TRACE_NONE);
+
int iStartView = iProc * iBaseViews;
int iNumViews = iBaseViews;
if (iProc < iExtraViews)
break;
}
}
-
+
}
{
if (m_bFail)
return false;
-
+
m_pProjView->GetDocument()->addReconstructor (this);
if (! theApp->getUseBackgroundTasks())
m_pDialogProgress = new wxProgressDialog (_T("Filtered Backprojection"), _T("Reconstruction Progress"), m_iTotalViews, m_pProjView->getFrame(), wxPD_CAN_ABORT | wxPD_AUTO_HIDE);
else
- m_pGauge = theApp->getBackgroundManager()->addTask (this, m_iTotalViews);
-
+ m_pGauge = theApp->getBackgroundManager()->addTask (this, m_iTotalViews, m_pProjView->GetFrame()->GetTitle());
+
m_iRunning = m_iNumThreads;
m_iViewsDone = 0;
m_pTimer = new Timer;
-
+
// starting all threads
for (int i = 0; i < m_iNumThreads; i++)
m_vecpThread[i]->Run();
-
-
+
if (m_bCancelled)
return false;
-
+
return true;
}
void
ThreadedReconstructor::cancel()
{
- if (m_bCancelled)
+ if (isDone() || m_bCancelled)
return;
+ m_bCancelled = true;
+ m_bCancelling = false;
+ cleanUp();
+}
- wxCriticalSectionLocker locker (m_criticalSection);
-
+void
+ThreadedReconstructor::cleanUp()
+{
+ wxCriticalSection cleanSection;
+ cleanSection.Enter();
+
for (int i = 0; i < m_iNumThreads; i++)
- if (m_vecpThread[i])
+ if (m_vecpThread[i] && m_vecpThread[i]->IsRunning()) {
+ m_vecpThread[i]->Pause();
m_vecpThread[i]->Delete();
-
- for (i = 0; i < m_iNumThreads; i++)
- delete m_vecpReconstructor[i];
-
- m_iNumThreads = 0;
- m_iRunning = 0;
- delete m_pDialogProgress;
- delete m_pTimer;
- m_pDialogProgress = NULL;
- m_pProjView->GetDocument()->removeReconstructor (this);
- m_bCancelled = true;
- m_bDone = true;
- theApp->getBackgroundManager()->taskDone (this);
+ }
+
+ for (i = 0; i < m_iNumThreads; i++) {
+ delete m_vecpChildImageFile[i];
+ m_vecpChildImageFile[i] = NULL;
+ }
+ for (i = 0; i < m_iNumThreads; i++) {
+ delete m_vecpReconstructor[i];
+ m_vecpReconstructor[i] = NULL;
+ }
+
+
+ m_iNumThreads = 0;
+ m_iRunning = 0;
+ delete m_pDialogProgress;
+ delete m_pTimer;
+ m_pDialogProgress = NULL;
+ m_pGauge = NULL;
+ setDone();
+ m_pProjView->GetDocument()->removeReconstructor (this);
+ theApp->getBackgroundManager()->taskDone (this);
+
+ cleanSection.Leave();
}
void
ThreadedReconstructor::onDone()
{
- for (int i = 0; i < m_iNumThreads; i++)
- delete m_vecpReconstructor[i];
+ wxCriticalSection doneSection;
+ doneSection.Enter();
- m_pProjView->GetDocument()->removeReconstructor (this);
- 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);
- rasterView->getFrame()->SetFocus();
- rasterView->getFrame()->Show(true);
- }
- *theApp->getLog() << m_strLabel << "\n";
- pImageFile->labelAdd (m_pProjView->GetDocument()->getProjections().getLabel());
- pImageFile->labelAdd (m_strLabel.c_str(), m_pTimer->timerEnd());
- delete m_pTimer;
-
- wxIdleEvent event;
- theApp->OnIdle(event);
- m_bDone = true;
- theApp->getBackgroundManager()->taskDone (this);
- // delete this;
+ m_pProjView->GetDocument()->removeReconstructor (this);
+ ImageFileDocument* pReconDoc = theApp->newImageDoc();
+ if (! pReconDoc) {
+ sys_error (ERR_SEVERE, "Unable to create image file");
+ doneSection.Leave();
+ return;
+ }
+
+ for (int i = 0; i < m_iNumThreads; i++) {
+ delete m_vecpReconstructor[i];
+ m_vecpReconstructor[i] = NULL;
+ }
+
+ 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);
+ rasterView->getFrame()->SetFocus();
+ rasterView->getFrame()->Show(true);
+ }
+ *theApp->getLog() << m_strLabel << "\n";
+ pImageFile->labelAdd (m_pProjView->GetDocument()->getProjections().getLabel());
+ pImageFile->labelAdd (m_strLabel.c_str(), m_pTimer->timerEnd());
+
+ doneSection.Leave();
+ cleanUp();
}
void
ThreadedReconstructor::OnThreadEvent (wxCommandEvent& event)
{
- if (m_bCancelling) {
- cancel();
+ if (isDone())
+ return;
+ wxCriticalSection eventSection;
+ eventSection.Enter();
+ if (isDone()) {
+ eventSection.Leave();
return;
}
-
- wxCriticalSectionLocker locker (m_criticalSection);
-
+
int iEventId = event.GetInt();
if (iEventId == RTHREAD_UNIT_COMPLETE) {
++m_iViewsDone;
- *theApp->getLog() << "Views done: " << static_cast<int>(m_iViewsDone) <<"\n";
-
+
+#ifdef DEBUG
+ if (theApp->getVerboseLogging())
+ *theApp->getLog() << "Views done: " << static_cast<int>(m_iViewsDone) <<"\n";
+#endif
+
if (m_pDialogProgress)
m_bCancelling = ! m_pDialogProgress->Update (m_iViewsDone - 1);
else if (m_pGauge) {
- m_pGauge->SetValue (m_iViewsDone - 1);
+ m_pGauge->SetValue (m_iViewsDone - 1);
+ eventSection.Leave();
m_bCancelling = theApp->getBackgroundManager()->isCancelling(this);
}
- if (m_iViewsDone == m_iTotalViews) {
- delete m_pDialogProgress;
- m_pDialogProgress = NULL;
- onDone();
- }
- if (m_bCancelling) {
+ if (! isDone() && m_bCancelling) {
+ eventSection.Leave();
cancel();
return;
}
m_iRunning--;
m_vecpThread[event.GetInt()] = NULL;
*theApp->getLog() << "Thread finished. Remaining threads: " << m_iRunning << "\n";
+ if (m_iRunning <= 0) {
+ eventSection.Leave();
+ onDone();
+ return;
+ }
}
else
*theApp->getLog() << "Got event #" << iEventId << "\n";
-
+
+ eventSection.Leave();
}
ImageFile*
-ThreadedReconstructor::getImageFile() const
+ThreadedReconstructor::getImageFile()
{
ImageFile* pImageFile = new ImageFile (m_iImageNX, m_iImageNY);
pImageFile->arrayDataClear();
ImageFileArray pArray = pImageFile->getArray();
-
+
int i;
for (i = 0; i < m_iNumThreads; i++) {
ImageFileArrayConst pChildArray = m_vecpChildImageFile[i]->getArray();
for (int iy = 0; iy < m_iImageNY; iy++)
pArray[ix][iy] += pChildArray[ix][iy];
}
-
- for (i = 0; i < m_iNumThreads; i++) {
- delete m_vecpChildImageFile[i];
-// m_vecpChildImageFile[i] = NULL;
- }
-
+
return (pImageFile);
}
bool
ThreadedReconstructor::testDone()
{
- return (m_iRunning <= 0 ? true : false);
+ return (m_iRunning <= 0 ? true : false);
}
ReconstructionThread::ReconstructionThread (ThreadedReconstructor* pSupervisor,
- Reconstructor* pReconstructor, int iThread, int iStartView, int iNumViews)
-: m_pSupervisor(pSupervisor), m_pReconstructor(pReconstructor),
- m_iStartView(iStartView), m_iNumViews(iNumViews), m_iThread(iThread),
- wxThread(wxTHREAD_DETACHED)
+ Reconstructor* pReconstructor, int iThread, int iStartView, int iNumViews)
+ : m_pSupervisor(pSupervisor), m_pReconstructor(pReconstructor),
+ m_iStartView(iStartView), m_iNumViews(iNumViews), m_iThread(iThread),
+ wxThread(wxTHREAD_DETACHED)
{
}
wxThread::ExitCode
ReconstructionThread::Entry ()
{
- wxCommandEvent eventProgress (wxEVT_COMMAND_MENU_SELECTED, RECONSTRUCTION_THREAD_EVENT);
- for (int iView = 0; iView < m_iNumViews; iView++) {
- if (TestDestroy()) {
+ wxCommandEvent eventProgress (wxEVT_COMMAND_MENU_SELECTED, RECONSTRUCTION_THREAD_EVENT);
+ for (int iView = 0; iView < m_iNumViews; iView++) {
+ if (TestDestroy()) {
wxString msg;
msg.Printf("TestDestroy TRUE at view #%d\n", iView);
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT );
event.SetString( msg );
wxPostEvent( theApp->getMainFrame(), event ); // send in a thread-safe way
return reinterpret_cast<wxThread::ExitCode>(RTHREAD_THREAD_CANCELLED);
- }
- m_pReconstructor->reconstructView (iView + m_iStartView, 1);
- eventProgress.SetInt (RTHREAD_UNIT_COMPLETE);
- wxPostEvent (m_pSupervisor, eventProgress);
- }
-
- eventProgress.SetInt (m_iThread); // Send back thread# that has finished
- wxPostEvent (m_pSupervisor, eventProgress);
-
- return reinterpret_cast<wxThread::ExitCode>(0);
+ }
+ m_pReconstructor->reconstructView (iView + m_iStartView, 1);
+ eventProgress.SetInt (RTHREAD_UNIT_COMPLETE);
+ wxPostEvent (m_pSupervisor, eventProgress);
+ }
+
+ eventProgress.SetInt (m_iThread); // Send back thread# that has finished
+ wxPostEvent (m_pSupervisor, eventProgress);
+
+ return reinterpret_cast<wxThread::ExitCode>(0);
}
void
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: threadrecon.h,v 1.2 2001/02/22 15:00:20 kevin Exp $
+** $Id: threadrecon.h,v 1.3 2001/02/22 18:22:40 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
class BackgroundTask : public wxEvtHandler {
+private:
+ bool m_bDone;
+
public:
BackgroundTask()
- : wxEvtHandler()
+ : m_bDone(false), wxEvtHandler()
{}
virtual ~BackgroundTask()
virtual void cancel() = 0;
virtual bool start() = 0;
+ virtual bool testDone() = 0;
+
+ bool isDone() const {return m_bDone;}
+ void setDone() { m_bDone = true; }
};
class Reconstructor;
volatile int m_iRunning;
volatile unsigned int m_iViewsDone;
volatile unsigned int m_iTotalViews;
- wxCriticalSection m_criticalSection;
+ //wxCriticalSection m_criticalSection;
wxString m_strLabel;
Timer* m_pTimer;
bool m_bCancelled;
bool m_bCancelling;
- bool m_bDone;
public:
ThreadedReconstructor (ProjectionFileView* pProjView,
~ThreadedReconstructor ();
void OnThreadEvent (wxCommandEvent& event);
- bool testDone();
void cancel();
void onDone();
bool start();
bool fail() const {return m_bFail;}
- bool getDone() const {return m_bDone;}
+ bool testDone();
+ void cleanUp();
- ImageFile* getImageFile() const;
+ ImageFile* getImageFile();
DECLARE_EVENT_TABLE()
};