projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r480: no message
[ctsim.git]
/
libctsim
/
scanner.cpp
diff --git
a/libctsim/scanner.cpp
b/libctsim/scanner.cpp
index d577ebb293cd45f11646e7241dd5a90af106c815..120ddb515dc44080148cb054984befe2d0f543e0 100644
(file)
--- a/
libctsim/scanner.cpp
+++ b/
libctsim/scanner.cpp
@@
-7,9
+7,9
@@
** Date Started: 1984
**
** This is part of the CTSim program
** Date Started: 1984
**
** This is part of the CTSim program
-** Copyright (
C) 1983-2000
Kevin Rosenberg
+** Copyright (
c) 1983-2001
Kevin Rosenberg
**
**
-** $Id: scanner.cpp,v 1.2
6 2001/01/27 21:02:20
kevin Exp $
+** $Id: scanner.cpp,v 1.2
8 2001/02/02 00:46:38
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
**
** 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
@@
-132,9
+132,8
@@
Scanner::Scanner (const Phantom& phm, const char* const geometryName, int nDet,
m_initPos.yd2 = m_dYCenter - m_dFocalLength;
m_initPos.angle = 0.0;
} else if (m_idGeometry == GEOMETRY_EQUILINEAR) {
m_initPos.yd2 = m_dYCenter - m_dFocalLength;
m_initPos.angle = 0.0;
} else if (m_idGeometry == GEOMETRY_EQUILINEAR) {
-#if 0
- double dAngle = (m_dFieldOfView / 2) / cos (asin (m_dFieldOfView / 2 / m_dFocalLength));
-#else
+
+ double dAngle1 = atan ((m_dFieldOfView / 2) / m_dFocalLength);
double dHalfSquare = m_dFieldOfView / SQRT2 / 2;
double dFocalPastPhm = m_dFocalLength - dHalfSquare;
if (dFocalPastPhm <= 0.) {
double dHalfSquare = m_dFieldOfView / SQRT2 / 2;
double dFocalPastPhm = m_dFocalLength - dHalfSquare;
if (dFocalPastPhm <= 0.) {
@@
-142,8
+141,12
@@
Scanner::Scanner (const Phantom& phm, const char* const geometryName, int nDet,
m_failMessage = "Focal Point inside of phantom";
return;
}
m_failMessage = "Focal Point inside of phantom";
return;
}
- double dAngle = atan( dHalfSquare / dFocalPastPhm );
-#endif
+ double dAngle2 = atan( dHalfSquare / dFocalPastPhm );
+ double dAngle = maxValue<double> (dAngle1, dAngle2);
+#if 0
+ double dAngle = (m_dFieldOfView / 2) / cos (asin (m_dFieldOfView / 2 / m_dFocalLength));
+#endif
+
double dHalfDetLen = 2 * m_dFocalLength * tan (dAngle);
m_detLen = dHalfDetLen * 2;
double dHalfDetLen = 2 * m_dFocalLength * tan (dAngle);
m_detLen = dHalfDetLen * 2;
@@
-162,9
+165,8
@@
Scanner::Scanner (const Phantom& phm, const char* const geometryName, int nDet,
m_initPos.yd2 = m_dYCenter - m_dFocalLength;
m_initPos.angle = 0.0;
} else if (m_idGeometry == GEOMETRY_EQUIANGULAR) {
m_initPos.yd2 = m_dYCenter - m_dFocalLength;
m_initPos.angle = 0.0;
} else if (m_idGeometry == GEOMETRY_EQUIANGULAR) {
-#if 0
- double dAngle = atan ((m_dFieldOfView / 2) / m_dFocalLength);
-#else
+ double dAngle1 = atan ((m_dFieldOfView / 2) / m_dFocalLength);
+
double dHalfSquare = m_dFieldOfView / SQRT2 / 2;
double dFocalPastPhm = m_dFocalLength - dHalfSquare;
if (dFocalPastPhm <= 0.) {
double dHalfSquare = m_dFieldOfView / SQRT2 / 2;
double dFocalPastPhm = m_dFocalLength - dHalfSquare;
if (dFocalPastPhm <= 0.) {
@@
-172,8
+174,9
@@
Scanner::Scanner (const Phantom& phm, const char* const geometryName, int nDet,
m_failMessage = "Focal Point inside of phantom";
return;
}
m_failMessage = "Focal Point inside of phantom";
return;
}
- double dAngle = atan ( dHalfSquare / dFocalPastPhm );
-#endif
+ double dAngle2 = atan ( dHalfSquare / dFocalPastPhm );
+ double dAngle = maxValue<double> (dAngle1, dAngle2);
+
m_detLen = 2 * dAngle;
m_detInc = m_detLen / m_nDet;
if (m_nDet % 2 == 0) // Adjust for Even number of detectors
m_detLen = 2 * dAngle;
m_detInc = m_detLen / m_nDet;
if (m_nDet % 2 == 0) // Adjust for Even number of detectors