* ctsim: Added "Verbose Logging", "Startup Tips", and
"Background processes" options to Preferences dialog.
+ * plotfile: Added scattergram plot functions
+
* ctsim: Added accelerator key for File-Properties
* views.cpp: Added out of memory checks to display for huge
* distribution: fixed problem with documentation files not
being included with the distribution [Reported by Ian Kay].
-
+
+ * sgp.cpp: Fixed bug in drawCircle
+
3.0.3 - Released 2/20/01
* ctsim: Fixed core dump on Linux with OpenGL
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.h,v 1.28 2001/03/10 23:14:15 kevin Exp $
+** $Id: projections.h,v 1.29 2001/03/10 23:56:58 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
#include "array2dfile.h"
#include "imagefile.h"
#include <complex>
+#include <vector>
+
//used for rebinning divergent beam projections to parallel
class ParallelRaysumCoordinate {
{return m_dT < rCompare.m_dT; }
bool lessThanTheta (ParallelRaysumCoordinate& rCompare)
{return m_dTheta < rCompare.m_dTheta; }
+
+ static compareByTheta(ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b)
+ { return a->m_dTheta > b->m_dTheta; }
+
+ static compareByT(ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b)
+ { return a->m_dT > b->m_dT; }
+
};
class ParallelRaysums {
-private:
- ParallelRaysumCoordinate** m_ppCoordinates;
- int m_iNumCoordinates;
-
public:
ParallelRaysums (Projections* pProjections);
~ParallelRaysums ();
- ParallelRaysumCoordinate** getCoordinates() {return m_ppCoordinates;}
+ typedef std::vector<ParallelRaysumCoordinate*> CoordinateContainer;
+ typedef CoordinateContainer::iterator CoordinateIterator;
+
+ CoordinateContainer& getCoordinates() {return m_vecpCoordinates;}
int getNumCoordinates() const {return m_iNumCoordinates;}
void getLimits (double* dMinT, double* dMaxT, double* dMinTheta, double* dMaxTheta) const;
+ CoordinateContainer& getSortedByT();
+ CoordinateContainer& getSortedByTheta();
+
+private:
+ CoordinateContainer m_vecpCoordinates;
+ CoordinateContainer m_vecpSortedByT;
+ CoordinateContainer m_vecpSortedByTheta;
+ int m_iNumCoordinates;
};
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.55 2001/03/10 23:14:16 kevin Exp $
+** $Id: projections.cpp,v 1.56 2001/03/10 23:56:58 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
ParallelRaysums::ParallelRaysums (Projections* pProjections)
-: m_ppCoordinates(NULL), m_iNumCoordinates(0)
+: m_iNumCoordinates(0)
{
int nDet = pProjections->nDet();
int nView = pProjections->nView();
double dFocalLength = pProjections->focalLength();
m_iNumCoordinates = nDet * nView;
- m_ppCoordinates = new ParallelRaysumCoordinate* [m_iNumCoordinates];
+ m_vecpCoordinates.reserve (m_iNumCoordinates);
for (int i = 0; i < m_iNumCoordinates; i++)
- m_ppCoordinates[i] = new ParallelRaysumCoordinate;
-
- ParallelRaysumCoordinate** ppCurrentCoordinate = m_ppCoordinates;
+ m_vecpCoordinates[i] = new ParallelRaysumCoordinate;
+ int iCoordinate = 0;
for (int iV = 0; iV < nView; iV++) {
double dViewAngle = pProjections->getDetectorArray(iV).viewAngle();
+
+ double dDetPos = dDetStart;
for (int iD = 0; iD < nDet; iD++) {
- ParallelRaysumCoordinate* pC = *ppCurrentCoordinate;
+ ParallelRaysumCoordinate* pC = m_vecpCoordinates[iCoordinate++];
+
if (iGeometry == Scanner::GEOMETRY_PARALLEL) {
- pC->m_dTheta = dViewAngle;
- pC->m_dT = dDetStart + (iD * dDetInc);
+ pC->m_dTheta = normalizeAngle (dViewAngle);
+ pC->m_dT = dDetPos;
+
} else if (iGeometry == Scanner::GEOMETRY_EQUILINEAR) {
- double dDetPos = dDetStart + (iD * dDetInc);
double dFanAngle = atan (dDetPos / pProjections->sourceDetectorLength());
- pC->m_dTheta = dViewAngle + dFanAngle;
+ pC->m_dTheta = normalizeAngle (dViewAngle + dFanAngle);
pC->m_dT = dFocalLength * sin(dFanAngle);
+
} else if (iGeometry == Scanner::GEOMETRY_EQUIANGULAR) {
- double dFanAngle = dDetStart + (iD * dDetInc);
- pC->m_dTheta = dViewAngle + dFanAngle;
- pC->m_dT = dFocalLength * sin(dFanAngle);
+ // fan angle is same as dDetPos
+ pC->m_dTheta = normalizeAngle (dViewAngle + dDetPos);
+ pC->m_dT = dFocalLength * sin (dDetPos);
}
- ++ppCurrentCoordinate;
+ dDetPos += dDetInc;
}
}
}
ParallelRaysums::~ParallelRaysums()
{
for (int i = 0; i < m_iNumCoordinates; i++)
- delete m_ppCoordinates[i];
+ delete m_vecpCoordinates[i];
+}
- delete m_ppCoordinates;
+ParallelRaysums::CoordinateContainer&
+ParallelRaysums::getSortedByTheta()
+{
+ if (m_vecpSortedByTheta.size() == 0) {
+ m_vecpSortedByTheta.reserve (m_iNumCoordinates);
+ for (int i = 0; i < m_iNumCoordinates; i++)
+ m_vecpSortedByTheta[i] = m_vecpCoordinates[i];
+ std::sort (m_vecpSortedByTheta.begin(), m_vecpSortedByTheta.end(), ParallelRaysumCoordinate::compareByTheta);
+ }
+
+ return m_vecpSortedByTheta;
+}
+
+ParallelRaysums::CoordinateContainer&
+ParallelRaysums::getSortedByT()
+{
+ if (m_vecpSortedByT.size() == 0) {
+ m_vecpSortedByT.reserve (m_iNumCoordinates);
+ for (int i = 0; i < m_iNumCoordinates; i++)
+ m_vecpSortedByT[i] = m_vecpCoordinates[i];
+ std::sort (m_vecpSortedByT.begin(), m_vecpSortedByT.end(), ParallelRaysumCoordinate::compareByT);
+ }
+
+ return m_vecpSortedByT;
}
+
void
ParallelRaysums::getLimits (double* dMinT, double* dMaxT, double* dMinTheta, double* dMaxTheta) const
{
if (m_iNumCoordinates <= 0)
return;
- *dMinT = *dMaxT = m_ppCoordinates[0]->m_dT;
- *dMinTheta = *dMaxTheta = m_ppCoordinates[0]->m_dTheta;
+ *dMinT = *dMaxT = m_vecpCoordinates[0]->m_dT;
+ *dMinTheta = *dMaxTheta = m_vecpCoordinates[0]->m_dTheta;
for (int i = 0; i < m_iNumCoordinates; i++) {
- double dT = m_ppCoordinates[i]->m_dT;
- double dTheta = m_ppCoordinates[i]->m_dTheta;
+ double dT = m_vecpCoordinates[i]->m_dT;
+ double dTheta = m_vecpCoordinates[i]->m_dTheta;
+
if (dT < *dMinT)
*dMinT = dT;
else if (dT > *dMaxT)
--------------------Configuration: libctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1B8.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EE.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" /D VERSION=\"3.1.0\" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
-"C:\ctsim\libctgraphics\ezplot.cpp"
+"C:\ctsim\libctsim\projections.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1B8.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1B9.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EE.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EF.tmp" with contents
[
/nologo /out:"Debug\libctsim.lib"
.\Debug\array2dfile.obj
.\Debug\transformmatrix.obj
.\Debug\xform.obj
]
-Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1B9.tmp"
+Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EF.tmp"
<h3>Output Window</h3>
Compiling...
-ezplot.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\RSP1BA.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" /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
-"C:\ctsim\src\views.cpp"
-]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BA.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BB.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1F0.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
\wx2.2.5\lib\zlibd.lib
\wx2.2.5\lib\tiffd.lib
]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BB.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1F0.tmp"
<h3>Output Window</h3>
-Compiling...
-views.cpp
Linking...
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.130 2001/03/10 23:14:16 kevin Exp $
+** $Id: views.cpp,v 1.131 2001/03/10 23:56:58 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
ParallelRaysums parallel (&rProj);
PlotFileDocument* pPlotDoc = theApp->newPlotDoc();
PlotFile& rPlot = pPlotDoc->getPlotFile();
- ParallelRaysumCoordinate** ppCoord = parallel.getCoordinates();
+ ParallelRaysums::CoordinateContainer& coordContainer = parallel.getCoordinates();
double* pdT = new double [parallel.getNumCoordinates()];
double* pdTheta = new double [parallel.getNumCoordinates()];
+
for (int i = 0; i < parallel.getNumCoordinates(); i++) {
- pdT[i] = (*ppCoord)->m_dT;
- pdTheta[i] = (*ppCoord)->m_dTheta;
- ++ppCoord;
+ pdT[i] = coordContainer[i]->m_dT;
+ pdTheta[i] = coordContainer[i]->m_dTheta;
}
rPlot.setCurveSize (2, parallel.getNumCoordinates(), true);
rPlot.addEzsetCommand ("title T-Theta Sampling");