From b7ba021860c13552972efed75d051f271f025505 Mon Sep 17 00:00:00 2001 From: taw27 Date: Mon, 22 Oct 2007 14:52:04 +0000 Subject: New cache format stores image features rather than 3D reflection coordinates git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@167 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/mapping.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/mapping.c') diff --git a/src/mapping.c b/src/mapping.c index 544a9ac..def29c4 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -19,6 +19,7 @@ #include "itrans.h" #include "image.h" #include "displaywindow.h" +#include "cache.h" static int mapping_map_to_space(ImageFeature *refl, double *ddx, double *ddy, double *ddz, double *twotheta) { @@ -110,7 +111,8 @@ static void mapping_map_features(ControlContext *ctx) { double nx, ny, nz, twotheta; if ( !mapping_map_to_space(&ctx->images->images[i].features->features[j], &nx, &ny, &nz, &twotheta) ) { - reflection_add(ctx->reflectionlist, nx, ny, nz, ctx->images->images[i].features->features[j].intensity, REFLECTION_NORMAL); + reflection_add(ctx->reflectionlist, nx, ny, nz, + ctx->images->images[i].features->features[j].intensity, REFLECTION_NORMAL); } } @@ -124,12 +126,17 @@ ReflectionList *mapping_create(ControlContext *ctx) { int i; - /* Find all the features */ - printf("MP: Analysing images..."); fflush(stdout); - for ( i=0; iimages->n_images; i++ ) { - ctx->images->images[i].features = itrans_process_image(&ctx->images->images[i], ctx->psmode); + if ( !ctx->cache_filename ) { + /* Find all the features */ + printf("MP: Analysing images..."); fflush(stdout); + for ( i=0; iimages->n_images; i++ ) { + ctx->images->images[i].features = itrans_process_image(&ctx->images->images[i], ctx->psmode); + } + printf("done.\n"); + } else { + printf("MP: Loading previous image analysis from '%s'\n", ctx->cache_filename); + if ( cache_load(ctx->images, ctx->cache_filename) ) return NULL; } - printf("done.\n"); mapping_map_features(ctx); -- cgit v1.2.3