aboutsummaryrefslogtreecommitdiff
path: root/src/reproject.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reproject.c')
-rw-r--r--src/reproject.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/reproject.c b/src/reproject.c
index c0dfc73..2ff7e6c 100644
--- a/src/reproject.c
+++ b/src/reproject.c
@@ -85,7 +85,6 @@ ImageFeatureList *reproject_get_reflections(ImageRecord *image, ReflectionList *
double theta;
double x, y;
double rx, ry, rz;
- double xtest, ytest;
/* Determine the intersection point */
xi = xl + s*nx; yi = yl + s*ny; zi = zl + s*nz;
@@ -154,10 +153,11 @@ ImageFeatureList *reproject_get_reflections(ImageRecord *image, ReflectionList *
return NULL;
}
+ x += image->x_centre;
+ y += image->y_centre;
+
/* Sanity check */
- xtest = x + image->x_centre;
- ytest = y + image->y_centre;
- if ( (xtest>=0) && (xtest<image->width) && (ytest>=0) && (ytest<image->height) ) {
+ if ( (x>=0) && (x<image->width) && (y>=0) && (y<image->height) ) {
/* Record the reflection */
image_add_feature_index(flist, x, y, image, reflection->intensity,
@@ -171,7 +171,7 @@ ImageFeatureList *reproject_get_reflections(ImageRecord *image, ReflectionList *
}
reflection = reflection->next;
-
+
} while ( reflection );
return flist;
@@ -229,29 +229,25 @@ static void reproject_mark_peaks(ControlContext *ctx) {
ImageFeatureList *rflist;
ImageFeatureList *flist;
size_t j;
- double xc, yc;
-
- xc = ctx->images->images[ctx->reproject_cur_image].x_centre;
- yc = ctx->images->images[ctx->reproject_cur_image].y_centre;
/* Draw the reprojected peaks */
rflist = reproject_get_reflections(&ctx->images->images[ctx->reproject_cur_image], ctx->cell_lattice);
for ( j=0; j<rflist->n_features; j++ ) {
- imagedisplay_add_mark(ctx->reproject_id, xc+rflist->features[j].x, yc+rflist->features[j].y, IMAGEDISPLAY_MARK_CIRCLE_1);
+ imagedisplay_add_mark(ctx->reproject_id, rflist->features[j].x, rflist->features[j].y, IMAGEDISPLAY_MARK_CIRCLE_1);
}
/* Now draw the original measured peaks */
flist = ctx->images->images[ctx->reproject_cur_image].features;
for ( j=0; j<flist->n_features; j++ ) {
- imagedisplay_add_mark(ctx->reproject_id, xc+flist->features[j].x, yc+flist->features[j].y, IMAGEDISPLAY_MARK_CIRCLE_2);
+ imagedisplay_add_mark(ctx->reproject_id, flist->features[j].x, flist->features[j].y, IMAGEDISPLAY_MARK_CIRCLE_2);
}
/* Now connect partners */
reproject_partner_features(rflist, &ctx->images->images[ctx->reproject_cur_image]);
for ( j=0; j<rflist->n_features; j++ ) {
if ( rflist->features[j].partner ) {
- imagedisplay_add_line(ctx->reproject_id, xc+rflist->features[j].x, yc+rflist->features[j].y,
- xc+rflist->features[j].partner->x, yc+rflist->features[j].partner->y,
+ imagedisplay_add_line(ctx->reproject_id, rflist->features[j].x, rflist->features[j].y,
+ rflist->features[j].partner->x, rflist->features[j].partner->y,
IMAGEDISPLAY_MARK_LINE_1);
}
}