diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-08-29 16:51:54 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-08-29 16:51:54 +0000 |
commit | 57645119798cd7db0d64807d8b617e13ac5e65c8 (patch) | |
tree | 4b5bf9dec98460f9e761a0f171427cd14f5f9f8f /src/mapping.c | |
parent | 5008d9a881f2ec07f12160025742786f73fa95ba (diff) |
Pre-alignment procedure
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@89 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/mapping.c')
-rw-r--r-- | src/mapping.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/mapping.c b/src/mapping.c index 86bf752..0990f81 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -15,7 +15,6 @@ #include "reflections.h" #include "control.h" -#include "imagedisplay.h" #include "itrans.h" ReflectionContext *mapping_create(ControlContext *ctx) { @@ -26,66 +25,6 @@ ReflectionContext *mapping_create(ControlContext *ctx) { /* Create reflection context */ rctx = reflection_init(); - if ( !ctx->prealign ) { - - int max_x, max_y; - uint16_t max_val; - int twidth, theight; - int x, y; - uint16_t *image_total; - ImageDisplay *sum_id; - ImageRecord total_record; - - /* Find centre of image stack - * Determine maximum size of image to accommodate, and allocate memory */ - twidth = 0; theight = 0; - for ( i=0; i<ctx->n_images; i++ ) { - if ( ctx->images[i].width > twidth ) twidth = ctx->images[i].width; - if ( ctx->images[i].height > theight ) theight = ctx->images[i].height; - } - image_total = malloc(twidth * theight * sizeof(uint16_t)); - memset(image_total, 0, twidth * theight * sizeof(uint16_t)); - - /* Add the image stack together */ - for ( i=0; i<ctx->n_images; i++ ) { - int xoffs, yoffs; - xoffs = (twidth - ctx->images[i].width)/2; - yoffs = (theight - ctx->images[i].height)/2; - for ( y=0; y<theight; y++ ) { - for ( x=0; x<twidth; x++ ) { - image_total[x + twidth*y] += ctx->images[i].image[x + twidth*y]/ctx->n_images; - } - } - } - - /* Locate the highest point */ - max_val = 0; max_x = 0; max_y = 0; - for ( y=0; y<theight; y++ ) { - for ( x=0; x<twidth; x++ ) { - if ( image_total[x + twidth*y] > max_val ) { - max_val = image_total[x + twidth*y]; - max_x = x; max_y = y; - } - } - } - - /* Record this measurement on all images */ - for ( i=0; i<ctx->n_images; i++ ) { - ctx->images[i].x_centre = max_x; - ctx->images[i].y_centre = max_y; - } - - /* Display */ - total_record.image = image_total; - total_record.width = twidth; - total_record.height = theight; - total_record.x_centre = max_x; - total_record.y_centre = max_y; - total_record.omega = ctx->omega; - sum_id = imagedisplay_open(total_record, "Sum of All Images", IMAGEDISPLAY_SHOW_CENTRE | IMAGEDISPLAY_SHOW_TILT_AXIS); - - } - /* Pass all images through itrans * (let itrans add the reflections to rctx for now) */ ctx->reflectionctx = rctx; |