** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.75 2001/09/24 11:20:08 kevin Exp $
+** $Id: projections.cpp,v 1.76 2001/09/24 11:29:41 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
// is there enough data in the data set? Should have 2(Pi+fanAngle)
// coverage minimum
- if ( m_nView < static_cast<int>((2*( M_PI + fanAngle ) ) / dbeta) -1 ){
+ if ( m_nView < static_cast<int>((2*( PI + fanAngle ) ) / dbeta) -1 ){
std::cerr << "Data set does not include 360 +2*FanBeamAngle views"
<< std::endl;
return (1);
}
- if (interpView < 0) // use default position at M_PI+fanAngle
+ if (interpView < 0) // use default position at PI+fanAngle
{
- interpView = static_cast<int> ((M_PI+fanAngle)/dbeta);
+ interpView = static_cast<int> ((PI+fanAngle)/dbeta);
}
else
{
- // check if there is M_PI+fanAngle data on either side of the
+ // check if there is PI+fanAngle data on either side of the
// of the specified image plane
- if ( interpView*dbeta < M_PI+fanAngle ||
- interpView*dbeta + M_PI + fanAngle > m_nView*dbeta)
+ if ( interpView*dbeta < PI+fanAngle ||
+ interpView*dbeta + PI + fanAngle > m_nView*dbeta)
{
std::cerr << "There isn't PI+fanAngle of data on either side of the requested interpolation view" << std::endl;
return(1);
}
- offsetView = interpView - static_cast<int>((M_PI+fanAngle)/dbeta);
+ offsetView = interpView - static_cast<int>((PI+fanAngle)/dbeta);
}
- int last_interp_view = static_cast<int> ((M_PI+fanAngle)/dbeta);
+ int last_interp_view = static_cast<int> ((PI+fanAngle)/dbeta);
// make a new array for data...
for ( int iDet = 0; iDet < m_nDet; iDet++) {
double gamma = (iDet -(m_nDet-1)/2)* dgamma ;
int newiView, newiDet;
- if (beta < M_PI+fanAngle) { //if (M_PI +fanAngle - beta > dbeta )
+ if (beta < PI+fanAngle) { //if (PI +fanAngle - beta > dbeta )
//newbeta = beta;
//newgamma = gamma;
newiDet = iDet;
newiView = iView;
}
- else // (beta > M_PI+fanAngle)
+ else // (beta > PI+fanAngle)
{
//newbeta = beta +2*gamma - 180;
//newgamma = -gamma;
newiDet = -iDet + (m_nDet -1);
- // newiView = nearest<int>((beta + 2*gamma - M_PI)/dbeta);
- //newiView = static_cast<int>(( (iView*dbeta) + 2*(iDet-(m_nDet-1)/2)*dgamma - M_PI)/dbeta);
- newiView = nearest<int>(( (iView*dbeta) + 2*(iDet-(m_nDet-1)/2)*dgamma - M_PI)/dbeta);
+ // newiView = nearest<int>((beta + 2*gamma - PI)/dbeta);
+ //newiView = static_cast<int>(( (iView*dbeta) + 2*(iDet-(m_nDet-1)/2)*dgamma - PI)/dbeta);
+ newiView = nearest<int>(( (iView*dbeta) + 2*(iDet-(m_nDet-1)/2)*dgamma - PI)/dbeta);
}
#ifdef DEBUG
#endif
if ( ( beta > fanAngle - 2*gamma)
- && ( beta < 2*M_PI + fanAngle -2*gamma) )
+ && ( beta < 2*PI + fanAngle -2*gamma) )
{ // not in region 1 or 8
DetectorValue* detval = (m_projData[iView+offsetView])->detValues();
DetectorValue* newdetval = (newdetarray[newiView])->detValues();
if ( beta > fanAngle - 2*gamma
&& beta <= 2*fanAngle ) { // in region 2
newdetval[newiDet] +=
- (beta +2*gamma - fanAngle)/(M_PI+2*gamma)
+ (beta +2*gamma - fanAngle)/(PI+2*gamma)
* detval[iDet];
} else if ( beta > 2*fanAngle
- && beta <= M_PI - 2*gamma) { // in region 3
+ && beta <= PI - 2*gamma) { // in region 3
newdetval[newiDet] +=
- (beta +2*gamma - fanAngle)/(M_PI+2*gamma)
+ (beta +2*gamma - fanAngle)/(PI+2*gamma)
* detval[iDet];
}
- else if ( beta > M_PI -2*gamma
- && beta <= M_PI + fanAngle ) { // in region 4
+ else if ( beta > PI -2*gamma
+ && beta <= PI + fanAngle ) { // in region 4
newdetval[newiDet] +=
- (beta +2*gamma - fanAngle)/(M_PI+2*gamma)
+ (beta +2*gamma - fanAngle)/(PI+2*gamma)
* detval[iDet];
}
- else if ( beta > M_PI + fanAngle
- && beta <= M_PI +2*fanAngle -2*gamma) { // in region 5
+ else if ( beta > PI + fanAngle
+ && beta <= PI +2*fanAngle -2*gamma) { // in region 5
newdetval[newiDet] +=
- (2*M_PI - beta - 2*gamma + fanAngle)/(M_PI-2*gamma)
+ (2*PI - beta - 2*gamma + fanAngle)/(PI-2*gamma)
*detval[iDet];
}
- else if ( beta > M_PI +2*fanAngle -2*gamma
- && beta <= 2*M_PI) { // in region 6
+ else if ( beta > PI +2*fanAngle -2*gamma
+ && beta <= 2*PI) { // in region 6
newdetval[newiDet] +=
- (2*M_PI - beta - 2*gamma + fanAngle)/(M_PI-2*gamma)
+ (2*PI - beta - 2*gamma + fanAngle)/(PI-2*gamma)
*detval[iDet];
}
- else if ( beta > 2*M_PI
- && beta <= 2*M_PI + fanAngle -2*gamma){ // in region 7
+ else if ( beta > 2*PI
+ && beta <= 2*PI + fanAngle -2*gamma){ // in region 7
newdetval[newiDet] +=
- (2*M_PI - beta -2*gamma + fanAngle)/(M_PI-2*gamma)
+ (2*PI - beta -2*gamma + fanAngle)/(PI-2*gamma)
*detval[iDet];
}
else
double fanAngle = m_dFanBeamAngle;
// is there enough data?
- if ( m_nView != static_cast<int>(( M_PI+fanAngle ) / dbeta) +1 ){
+ if ( m_nView != static_cast<int>(( PI+fanAngle ) / dbeta) +1 ){
std::cerr << "Data set does seem have enough data to be a halfscan data set" << std::endl;
return (1);
}
double beta2 = iView2 * dbeta;
for ( int iDet2 = 0; iDet2 < m_nDet; iDet2++) {
double gamma2 = (iDet2 -(m_nDet-1)/2)* dgamma ;
- if ( ( beta2 >= M_PI - 2*gamma2) ) { // in redundant data region
+ if ( ( beta2 >= PI - 2*gamma2) ) { // in redundant data region
int iView1, iDet1;
iDet1 = (m_nDet -1) - iDet2;
- //iView1 = nearest<int>((beta2 + 2*gamma2 - M_PI)/dbeta);
+ //iView1 = nearest<int>((beta2 + 2*gamma2 - PI)/dbeta);
iView1 = nearest<int>(( (iView2*dbeta)
- + 2*(iDet2-(m_nDet-1)/2)*dgamma - M_PI)/dbeta);
+ + 2*(iDet2-(m_nDet-1)/2)*dgamma - PI)/dbeta);
DetectorValue* detval2 = (m_projData[iView2])->detValues();
gamma1 = -gamma2;
if ( beta1 <= (fanAngle - 2*gamma1) )
x = beta1 / ( fanAngle - 2*gamma1);
- else if ( (fanAngle - 2*gamma1 <= beta1 ) && beta1 <= M_PI - 2*gamma1)
+ else if ( (fanAngle - 2*gamma1 <= beta1 ) && beta1 <= PI - 2*gamma1)
x = 1;
- else if ( (M_PI - 2*gamma1 <= beta1 ) && ( beta1 <=M_PI + fanAngle) )
- x = (M_PI +fanAngle - beta1)/(fanAngle + 2*gamma1);
+ else if ( (PI - 2*gamma1 <= beta1 ) && ( beta1 <=PI + fanAngle) )
+ x = (PI +fanAngle - beta1)/(fanAngle + 2*gamma1);
else {
std::cerr << "Shouldn't be here!"<< std::endl;
return(4);
}
}
// heuristic scaling, why this factor?
- double scalefactor = m_nView * m_rotInc / M_PI;
+ double scalefactor = m_nView * m_rotInc / PI;
for ( int iView = 0 ; iView < m_nView; iView++) {
DetectorValue* detval = (m_projData[iView])->detValues();
for ( int iDet = 0; iDet < m_nDet; iDet++) {
<pre>
<h1>Build Log</h1>
<h3>
---------------------Configuration: ctsim - Win32 Debug--------------------
+--------------------Configuration: libctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP12.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP25.tmp" with contents
[
-/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.6\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.6\src\png" /I "\wx2.2.6\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D "_DEBUG" /D CTSIMVERSION=\"3.5.0\" /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 "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"
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "\wx2.2.6\src\png" /I "\wx2.2.6\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.6\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\projections.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP12.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP13.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP25.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP26.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.6\lib" /libpath:"\dicom\ctn\winctn\ctn_lib\Debug"
-.\Debug\backgroundmgr.obj
-.\Debug\backgroundsupr.obj
-.\Debug\ctsim.obj
-.\Debug\dialogs.obj
-.\Debug\dlgezplot.obj
-.\Debug\dlgprojections.obj
-.\Debug\dlgreconstruct.obj
-.\Debug\docs.obj
-.\Debug\graph3dview.obj
-.\Debug\threadproj.obj
-.\Debug\threadraster.obj
-.\Debug\threadrecon.obj
-.\Debug\tips.obj
-.\Debug\views.obj
-.\Debug\ctsim.res
-\ctsim\msvc\libctsim\Debug\libctsim.lib
-"\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib"
-"\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib"
-\dicom\ctn\winctn\ctn_lib\Debug\ctn_lib.lib
-\wx2.2.6\lib\jpegd.lib
-\wx2.2.6\lib\pngd.lib
-\wx2.2.6\lib\tiffd.lib
-\wx2.2.6\lib\wxd.lib
-\wx2.2.6\lib\xpmd.lib
-\wx2.2.6\lib\zlibd.lib
+/nologo /out:"Debug\libctsim.lib"
+.\Debug\array2dfile.obj
+.\Debug\backprojectors.obj
+.\Debug\clip.obj
+.\Debug\consoleio.obj
+.\Debug\ctndicom.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 @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP13.tmp"
+Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP26.tmp"
<h3>Output Window</h3>
Compiling...
-ctsim.cpp
-Linking...
-
-
-
-<h3>Results</h3>
-ctsim.exe - 0 error(s), 0 warning(s)
-</pre>
-</body>
-</html>
+projections.cpp
+Creating library...
+<h3>
+--------------------Configuration: ctsim - Win32 Debug--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP27.tmp" with contents
+[
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.6\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.6\src\png" /I "\wx2.2.6\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D "_DEBUG" /D CTSIMVERSION=\"3.5.0\" /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 "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\backgroundsupr.cpp"
+"C:\ctsim\src\dlgezplot.cpp"
+"C:\ctsim\src\graph3dview.cpp"
+"C:\ctsim\src\threadproj.cpp"
+"C:\ctsim\src\threadraster.cpp"
+"C:\ctsim\src\threadrecon.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP27.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP28.tmp" with contents
+[
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.6\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.6\src\png" /I "\wx2.2.6\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D "_DEBUG" /D CTSIMVERSION=\"3.5.0\" /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 "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\dialogs.cpp"
+"C:\ctsim\src\dlgprojections.cpp"
+"C:\ctsim\src\dlgreconstruct.cpp"
+"C:\ctsim\src\docs.cpp"
+"C:\ctsim\src\views.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP28.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP29.tmp" with co
\ No newline at end of file