aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-08-29 13:52:59 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-08-29 13:52:59 +0000
commit28fe29530075a28f6ac7a2f86628a00c7cb69af9 (patch)
tree3e3d79799930f1cd502a969a24c889ac8110262c /src/main.c
parent3bd37169d751c7b5f0b36847ea902735d9234e63 (diff)
Revamp ImageDisplay
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@86 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/main.c b/src/main.c
index 125909b..a6ad44c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,6 +33,29 @@
#include "mapping.h"
#include "prealign.h"
+static void main_do_reconstruction(ControlContext *ctx, int val) {
+
+ if ( ctx->inputfiletype != INPUT_CACHE ) {
+ mapping_create(ctx);
+ }
+
+ if ( (ctx->inputfiletype != INPUT_CACHE) && !val && ctx->reflectionctx && ctx->savecache ) {
+ cache_save(ctx->filename, ctx->reflectionctx);
+ }
+
+ if ( !val && (ctx->rmode == RECONSTRUCTION_PREDICTION) && (ctx->reflectionctx) ) {
+ val = ipr_refine(ctx);
+ }
+
+ if ( !val && (ctx->reflectionctx) ) {
+ displaywindow_open(ctx);
+ } else {
+ fprintf(stderr, "Reconstruction failed.\n");
+ gtk_exit(0);
+ }
+
+}
+
static gint main_method_window_response(GtkWidget *method_window, gint response, ControlContext *ctx) {
if ( response == GTK_RESPONSE_OK ) {
@@ -81,25 +104,8 @@ static gint main_method_window_response(GtkWidget *method_window, gint response,
if ( ctx->prealign ) {
prealign_do_series(ctx);
- }
-
- if ( ctx->inputfiletype != INPUT_CACHE ) {
- mapping_create(ctx);
- }
-
- if ( (ctx->inputfiletype != INPUT_CACHE) && !val && ctx->reflectionctx && ctx->savecache ) {
- cache_save(ctx->filename, ctx->reflectionctx);
- }
-
- if ( !val && (ctx->rmode == RECONSTRUCTION_PREDICTION) && (ctx->reflectionctx) ) {
- val = ipr_refine(ctx);
- }
-
- if ( !val && (ctx->reflectionctx) ) {
- displaywindow_open(ctx);
} else {
- fprintf(stderr, "Reconstruction failed.\n");
- gtk_exit(0);
+ main_do_reconstruction(ctx, val);
}
} else {