summaryrefslogtreecommitdiffstats
path: root/src/GeometryUtil2D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-09-27 15:16:26 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-09-27 15:16:26 +0200
commit54af7e8e22a3f1c9d90b13291b28d39778c05564 (patch)
tree260310b16d624261bb80f82979af27750022259b /src/GeometryUtil2D.cpp
parent1fec36f7ccadd5f7dcf2bb59b0654dc53653b0f3 (diff)
parentb629db207bb263495bfff2e61ce189ccac27b4b9 (diff)
downloadastra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.gz
astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.bz2
astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.tar.xz
astra-54af7e8e22a3f1c9d90b13291b28d39778c05564.zip
Merge branch 'consistent_scaling'
Diffstat (limited to 'src/GeometryUtil2D.cpp')
-rw-r--r--src/GeometryUtil2D.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GeometryUtil2D.cpp b/src/GeometryUtil2D.cpp
index e09a3bc..806572f 100644
--- a/src/GeometryUtil2D.cpp
+++ b/src/GeometryUtil2D.cpp
@@ -28,6 +28,7 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
#include "astra/GeometryUtil2D.h"
#include <cmath>
+#include <cstdio>
namespace astra {
@@ -158,14 +159,16 @@ bool getFanParameters(const SFanProjection &proj, unsigned int iProjDets, float
// project origin on detector line ( == project source on detector line)
double t = (- proj.fDetSX) * proj.fDetUX + (- proj.fDetSY) * proj.fDetUY;
+ t /= (proj.fDetUX * proj.fDetUX + proj.fDetUY * proj.fDetUY);
fOffset = (float)t - 0.5*iProjDets;
- // TODO: CHECKME
fOriginDetector = sqrt((proj.fDetSX + t * proj.fDetUX)*(proj.fDetSX + t * proj.fDetUX) + (proj.fDetSY + t * proj.fDetUY)*(proj.fDetSY + t * proj.fDetUY));
- //float fAngle = atan2(proj.fDetSX + t * proj.fDetUX - proj.fSrcX, proj.fDetSY + t * proj.fDetUY); // TODO: Fix order + sign
- fAngle = atan2(proj.fDetUY, proj.fDetUX); // TODO: Check order + sign
+ fAngle = atan2(proj.fDetUY, proj.fDetUX);
+
+ //fprintf(stderr, "getFanParams: s = (%f,%f) d = (%f,%f) u = (%f,%f)\n", proj.fSrcX, proj.fSrcY, proj.fDetSX, proj.fDetSY, proj.fDetUX, proj.fDetUY);
+ //fprintf(stderr, "getFanParams: fOS = %f, fOD = %f, detsize = %f, offset = %f (t = %f), angle = %f\n", fOriginSource, fOriginDetector, fDetSize, fOffset, t, fAngle);
return true;
}