aboutsummaryrefslogtreecommitdiff
path: root/src/reproject.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-09-05 23:51:27 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-09-05 23:51:27 +0000
commit787209d148adb0d7fd2aecfba641d9232bba6f52 (patch)
treee74b97890b48138fc3df986cfa7e8050033337d3 /src/reproject.c
parente00d6b3da60009117012f1d31dbdd7b4ed129480 (diff)
Debug reprojector (needs debodging)
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@122 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/reproject.c')
-rw-r--r--src/reproject.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/reproject.c b/src/reproject.c
index 9a54281..78cced6 100644
--- a/src/reproject.c
+++ b/src/reproject.c
@@ -42,19 +42,21 @@ ImageReflection *reproject_get_reflections(ImageRecord image, size_t *n, Reflect
nxt = 0.0; nyt = 0.0; nzt = 1.0;
nx = nxt; ny = cos(tilt)*nyt + sin(tilt)*nzt; nz = -sin(tilt)*nyt + cos(tilt)*nzt;
nxt = nx; nyt = ny; nzt = nz;
- nx = nxt*cos(omega) + nyt*sin(omega); ny = -nxt*sin(omega) + nyt*cos(omega); nz = nzt;
+ nx = nxt*cos(-omega) + nyt*sin(-omega); ny = -nxt*sin(-omega) + nyt*cos(-omega); nz = nzt;
kx = nx / image.lambda;
ky = ny / image.lambda;
kz = nz / image.lambda; /* This is the centre of the Ewald sphere */
reflection_add(ctx->reflectionctx, kx, ky, kz, 1, REFLECTION_VECTOR_MARKER_1);
/* Determine where "up" is */
- uxt = sin(-omega); uyt = cos(-omega); uzt = 0;
+ uxt = 0.0; uyt = 1.0; uzt = 0.0;
ux = uxt; uy = cos(tilt)*uyt + sin(tilt)*uzt; uz = -sin(tilt)*uyt + cos(tilt)*uzt;
uxt = ux; uyt = uy; uzt = uz;
- ux = uxt*cos(omega) + uyt*-sin(omega); uy = -uxt*sin(omega) + uyt*cos(omega); uz = uzt;
+ ux = uxt*cos(-omega) + uyt*-sin(omega); uy = -uxt*sin(omega) + uyt*cos(omega); uz = uzt;
reflection_add(ctx->reflectionctx, ux*50, uy*50, uz*50, 1, REFLECTION_VECTOR_MARKER_2);
+ printf("angle between k and u is %f\n", rad2deg(angle_between(kx, ky, kz, ux, uy, uz)));
+
do {
double xl, yl, zl;
@@ -116,6 +118,8 @@ ImageReflection *reproject_get_reflections(ImageRecord image, size_t *n, Reflect
else if ( (psi < M_PI_2) && (disc >= M_PI_2) ) psi = 3*M_PI_2 + psi; /* Case 4 */
psi = M_PI_2 - psi; /* Anticlockwise from "+x" instead of clockwise from "up" */
+ psi += omega;
+
/* Calculate image coordinates from polar representation */
if ( image.fmode == FORMULATION_CLEN ) {
x = image.camera_len*sin(theta)*cos(psi);
@@ -135,7 +139,7 @@ ImageReflection *reproject_get_reflections(ImageRecord image, size_t *n, Reflect
/* Adjust centre */
x += image.x_centre;
y += image.y_centre;
-
+ x = image.width - 1 - x; /* Debodge me */
/* Sanity check */
if ( (x>=0) && (x<image.width) && (y>=0) && (y<image.height) ) {