** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: interpolator.h,v 1.3 2001/03/22 02:30:00 kevin Exp $
+** $Id: interpolator.h,v 1.4 2001/03/24 05:28:28 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
double interpolate (double x);
};
+
class CubicPolyInterpolator {
private:
const double* const m_pdY;
};
+template<class T>
+class BicubicPolyInterpolator {
+private:
+ T** const m_ppMatrix;
+ const unsigned int m_nx;
+ const unsigned int m_ny;
+
+public:
+ BicubicPolyInterpolator (T** ppMatrix, unsigned int nx, unsigned int ny)
+ : m_ppMatrix(ppMatrix), m_nx(nx), m_ny(ny)
+ {}
+
+ T interpolate (double dXPos, double dYPos)
+ {
+ int iFloorX = floor (dXPos);
+ int iFloorY = floor (dYPos);
+ double dXFrac = dXPos - iFloorX;
+ double dYFrac = dYPos - iFloorY;
+
+ T result = 0;
+
+ // Need to add code
+
+ return result;
+ }
+};
+
+
template<class T>
class LinearInterpolator {
private:
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: phantom.cpp,v 1.30 2001/02/27 03:59:30 kevin Exp $
+** $Id: phantom.cpp,v 1.31 2001/03/24 05:28:28 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 "ct.h"
const int PhantomElement::POINTS_PER_CIRCLE = 360;
-const double PhantomElement::SCALE_PELEM_EXTENT=0.005; // increase pelem limits by 0.5%
+const double PhantomElement::SCALE_PELEM_EXTENT=0.000; // increase pelem limits by 0.5%
+//const double PhantomElement::SCALE_PELEM_EXTENT=0.005; // increase pelem limits by 0.5%
const int Phantom::PHM_INVALID = -1;
const int Phantom::PHM_HERMAN = 0;
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.69 2001/03/22 02:30:00 kevin Exp $
+** $Id: projections.cpp,v 1.70 2001/03/24 05:28:28 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
std::complex<double>** ppcDetValue = new std::complex<double>* [m_nView];
double dInterpScale = (m_nDet-1) / static_cast<double>(iInterpDet-1) / SQRT2;
+ double dFFTScale = 1. / static_cast<double>(iInterpDet * iInterpDet);
+ dFFTScale /= 2; // Not sure why this scaling is necessary
for (unsigned int iView = 0; iView < m_nView; iView++) {
DetectorValue* detval = getDetectorArray(iView).detValues();
LinearInterpolator<DetectorValue> projInterp (detval, m_nDet);
ppcDetValue[iView] = new std::complex<double> [iNumInterpDetWithZeros];
for (unsigned int iD = 0; iD < iNumInterpDetWithZeros; iD++)
- ppcDetValue[iView][iD] = std::complex<double> (pcIn[iD].re / iInterpDet / (iInterpDet/2), pcIn[iD].im / iInterpDet / (iInterpDet/2));
+ ppcDetValue[iView][iD] = std::complex<double> (pcIn[iD].re * dFFTScale, pcIn[iD].im * dFFTScale);
Fourier::shuffleFourierToNaturalOrder (ppcDetValue[iView], iNumInterpDetWithZeros);
}
if (phi < 0)
phi += TWOPI;
-
if (phi >= PI) {
phi -= PI;
r = -r;
double** ppdDet, unsigned int nView, unsigned int nDet, unsigned int nDetWithZeros, int iInterpolationID)
{
typedef std::complex<double> complexValue;
- BilinearInterpolator<complexValue> bilinear (ppcDetValue, nView, nDetWithZeros);
+
+ BilinearInterpolator<complexValue>* pBilinear;
+ if (iInterpolationID == POLAR_INTERP_BILINEAR)
+ pBilinear = new BilinearInterpolator<complexValue> (ppcDetValue, nView, nDetWithZeros);
+
+ BicubicPolyInterpolator<complexValue>* pBicubic;
+ if (iInterpolationID == POLAR_INTERP_BICUBIC)
+ pBicubic = new BicubicPolyInterpolator<complexValue> (ppcDetValue, nView, nDetWithZeros);
for (unsigned int ix = 0; ix < ny; ix++) {
for (unsigned int iy = 0; iy < ny; iy++) {
v[ix][iy] = 0;
} else if (iInterpolationID == POLAR_INTERP_BILINEAR) {
-#if 1
- std::complex<double> vInterp = bilinear.interpolate (ppdView[ix][iy], ppdDet[ix][iy]);
+ std::complex<double> vInterp = pBilinear->interpolate (ppdView[ix][iy], ppdDet[ix][iy]);
v[ix][iy] = vInterp.real();
if (vImag)
vImag[ix][iy] = vInterp.imag();
-#else
- int iFloorView = ::floor (ppdView[ix][iy]);
- double dFracView = ppdView[ix][iy] - iFloorView;
- int iFloorDet = ::floor (ppdDet[ix][iy]);
- double dFracDet = ppdDet[ix][iy] - iFloorDet;
-
- if (iFloorDet >= 0 && iFloorView >= 0) {
- std::complex<double> v1 = ppcDetValue[iFloorView][iFloorDet];
- std::complex<double> v2, v3, v4;
- if (iFloorView < nView - 1)
- v2 = ppcDetValue[iFloorView + 1][iFloorDet];
- else
- v2 = ppcDetValue[0][iFloorDet];
- if (iFloorDet < nDetWithZeros - 1)
- v4 = ppcDetValue[iFloorView][iFloorDet+1];
- else
- v4 = v1;
- if (iFloorView < nView - 1 && iFloorDet < nDetWithZeros - 1)
- v3 = ppcDetValue [iFloorView+1][iFloorDet+1];
- else if (iFloorView < nView - 1)
- v3 = v2;
- else
- v3 = ppcDetValue[0][iFloorDet+1];
-
- std::complex<double> vInterp = (1 - dFracView) * (1 - dFracDet) * v1 +
- dFracView * (1 - dFracDet) * v2 + dFracView * dFracDet * v3 +
- dFracDet * (1 - dFracView) * v4;
- v[ix][iy] = vInterp.real();
- if (vImag)
- vImag[ix][iy] = vInterp.imag();
- } else {
- // sys_error (ERR_SEVERE, "Can't find projection data for ix=%d,iy=%d with radView=%f and radDet=%f", ix, iy, ppdView[ix][iy], ppdDet[ix][iy]);
- v[ix][iy] = 0;
- if (vImag)
- vImag[ix][iy] = 0;
- }
-#endif
} else if (iInterpolationID == POLAR_INTERP_BICUBIC) {
- v[ix][iy] =0;
- if (vImag)
- vImag[ix][iy] = 0;
+ std::complex<double> vInterp = pBicubic->interpolate (ppdView[ix][iy], ppdDet[ix][iy]);
+ v[ix][iy] = vInterp.real();
+ if (vImag)
+ vImag[ix][iy] = vInterp.imag();
}
}
}
--------------------Configuration: libctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP45.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPBD.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\libctsim\backprojectors.cpp"
-"C:\ctsim\libctgraphics\dlgezplot.cpp"
-"C:\ctsim\libctsim\filter.cpp"
-"C:\ctsim\libctsim\fourier.cpp"
-"C:\ctsim\libctsim\globalvars.cpp"
-"C:\ctsim\libctsupport\hashtable.cpp"
-"C:\ctsim\libctsim\imagefile.cpp"
-"C:\ctsim\libctsupport\interpolator.cpp"
-"C:\ctsim\libctsim\phantom.cpp"
-"C:\ctsim\libctsupport\plotfile.cpp"
-"C:\ctsim\libctgraphics\pol.cpp"
-"C:\ctsim\libctsim\procsignal.cpp"
"C:\ctsim\libctsim\projections.cpp"
-"C:\ctsim\libctsim\reconstruct.cpp"
-"C:\ctsim\libctsim\scanner.cpp"
-"C:\ctsim\libctsupport\syserror.cpp"
-"C:\ctsim\libctsim\trace.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP45.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP46.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPBD.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPBE.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\RSP46.tmp"
+Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPBE.tmp"
<h3>Output Window</h3>
Compiling...
projections.cpp
-backprojectors.cpp
-dlgezplot.cpp
-filter.cpp
-fourier.cpp
-globalvars.cpp
-hashtable.cpp
-imagefile.cpp
-interpolator.cpp
-phantom.cpp
-plotfile.cpp
-pol.cpp
-procsignal.cpp
-reconstruct.cpp
-scanner.cpp
-syserror.cpp
-trace.cpp
Creating library...
<h3>
--------------------Configuration: ctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP47.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPBF.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" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX"ctsim.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\ctsim\src\backgroundmgr.cpp"
"C:\ctsim\src\threadraster.cpp"
"C:\ctsim\src\threadrecon.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP47.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP48.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPBF.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPC0.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"ctsim.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\ctsim\src\ctsim.cpp"
"C:\ctsim\src\docs.cpp"
"C:\ctsim\src\views.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP48.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP49.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPC0.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPC1.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\RSP49.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSPC1.tmp"
<h3>Output Window</h3>
Compiling...
backgroundmgr.cpp