summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-04-02 15:56:57 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2019-09-25 14:10:09 +0200
commit975537c8c68b115399af522cb1a0a1e731eca576 (patch)
tree4cb1d88f2e10304ef4750fa8f06fba9af5bfc1ac /src
parent4fba091ff811ac5e6035cf95efdaae6681e6cc46 (diff)
downloadastra-975537c8c68b115399af522cb1a0a1e731eca576.tar.gz
astra-975537c8c68b115399af522cb1a0a1e731eca576.tar.bz2
astra-975537c8c68b115399af522cb1a0a1e731eca576.tar.xz
astra-975537c8c68b115399af522cb1a0a1e731eca576.zip
Fix fan-beam FBP scaling
Diffstat (limited to 'src')
-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;
}