From c1ada5f6bc86650342c9f8eafc676fc47e2eed22 Mon Sep 17 00:00:00 2001 From: taw27 Date: Thu, 22 Nov 2007 16:08:48 +0000 Subject: Make display of summed image stack optional git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@203 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/control.h | 2 ++ src/main.c | 15 ++++++++++++--- src/prealign.c | 16 +++++++++------- src/prealign.h | 4 ++-- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/control.h b/src/control.h index df6eb02..4bb828d 100644 --- a/src/control.h +++ b/src/control.h @@ -50,6 +50,7 @@ typedef struct cctx_struct { unsigned int prealign; unsigned int finecentering; unsigned int have_centres; + unsigned int sum_stack; /* Input filename */ char *filename; @@ -86,6 +87,7 @@ typedef struct cctx_struct { GtkWidget *combo_peaksearch; GtkWidget *checkbox_prealign; GtkWidget *checkbox_finecentering; + GtkWidget *checkbox_sumstack; GtkWidget *cache_file_selector; /* DirAx low-level stuff */ diff --git a/src/main.c b/src/main.c index be23b1b..7ee9c89 100644 --- a/src/main.c +++ b/src/main.c @@ -42,9 +42,9 @@ void main_do_reconstruction(ControlContext *ctx) { int val = 0; /* Initial centering */ - prealign_sum_stack(ctx->images, ctx->have_centres); + prealign_sum_stack(ctx->images, ctx->have_centres, ctx->sum_stack); if ( ctx->finecentering ) { - prealign_fine_centering(ctx->images); + prealign_fine_centering(ctx->images, ctx->sum_stack); } if ( !ctx->cache_filename ) { @@ -109,6 +109,12 @@ static gint main_method_window_response(GtkWidget *method_window, gint response, ctx->finecentering = FALSE; } + if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ctx->checkbox_sumstack)) ) { + ctx->sum_stack = TRUE; + } else { + ctx->sum_stack = FALSE; + } + if ( ctx->psmode == PEAKSEARCH_CACHED ) { ctx->cache_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(ctx->cache_file_selector)); if ( !ctx->cache_filename ) { @@ -179,7 +185,7 @@ void main_method_dialog_open(ControlContext *ctx) { gtk_box_pack_start(GTK_BOX(GTK_DIALOG(method_window)->vbox), GTK_WIDGET(hbox), FALSE, FALSE, 7); gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(vbox), FALSE, TRUE, 10); - table = gtk_table_new(4, 2, FALSE); + table = gtk_table_new(5, 2, FALSE); gtk_table_set_row_spacings(GTK_TABLE(table), 5); peaksearch_label = gtk_label_new("Peak Search: "); @@ -209,6 +215,9 @@ void main_method_dialog_open(ControlContext *ctx) { gtk_table_attach_defaults(GTK_TABLE(table), ctx->checkbox_finecentering, 1, 3, 4, 5); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctx->checkbox_finecentering), TRUE); + ctx->checkbox_sumstack = gtk_check_button_new_with_label("Show summed image stage"); + gtk_table_attach_defaults(GTK_TABLE(table), ctx->checkbox_sumstack, 1, 3, 5, 6); + if ( ctx->inputfiletype == INPUT_CACHE ) { gtk_widget_set_sensitive(GTK_WIDGET(ctx->combo_peaksearch), FALSE); gtk_combo_box_set_active(GTK_COMBO_BOX(ctx->combo_peaksearch), 5); diff --git a/src/prealign.c b/src/prealign.c index 9aaa72b..fe3805f 100644 --- a/src/prealign.c +++ b/src/prealign.c @@ -76,7 +76,7 @@ void prealign_do_series(ControlContext *ctx) { /* Sum the image stack, taking pre-existing centres into account if available. * If no centres available, select the brightest pixel from the sum and assign * that as the centre to all the images. */ -void prealign_sum_stack(ImageList *list, int have_centres) { +void prealign_sum_stack(ImageList *list, int have_centres, int sum_stack) { int twidth, theight; int mnorth, msouth, mwest, meast; @@ -170,16 +170,18 @@ void prealign_sum_stack(ImageList *list, int have_centres) { } /* Display */ - total_record.image = image_total; - total_record.width = twidth; - total_record.height = theight; - sum_id = imagedisplay_open(total_record, "Sum of All Images", IMAGEDISPLAY_SHOW_CENTRE | IMAGEDISPLAY_SHOW_TILT_AXIS | IMAGEDISPLAY_FREE); + if ( sum_stack ) { + total_record.image = image_total; + total_record.width = twidth; + total_record.height = theight; + sum_id = imagedisplay_open(total_record, "Sum of All Images", IMAGEDISPLAY_SHOW_CENTRE | IMAGEDISPLAY_SHOW_TILT_AXIS | IMAGEDISPLAY_FREE); + } } #define CENTERING_WINDOW_SIZE 50 -void prealign_fine_centering(ImageList *list) { +void prealign_fine_centering(ImageList *list, int sum_stack) { int i; @@ -243,7 +245,7 @@ void prealign_fine_centering(ImageList *list) { } - prealign_sum_stack(list, TRUE); + prealign_sum_stack(list, TRUE, sum_stack); } diff --git a/src/prealign.h b/src/prealign.h index cb8bf9f..105e5c7 100644 --- a/src/prealign.h +++ b/src/prealign.h @@ -19,8 +19,8 @@ #include "image.h" extern void prealign_do_series(ControlContext *ctx); -extern void prealign_sum_stack(ImageList *list, int have_centres); -extern void prealign_fine_centering(ImageList *list); +extern void prealign_sum_stack(ImageList *list, int have_centres, int sum_stack); +extern void prealign_fine_centering(ImageList *list, int sum_stack); extern void prealign_feature_centering(ImageList *list); #endif /* PREALIGN_H */ -- cgit v1.2.3