diff options
author | gfb21 <gfb21@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-02-17 13:50:28 +0000 |
---|---|---|
committer | gfb21 <gfb21@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-02-17 13:50:28 +0000 |
commit | e3bfcf077994c70aa965f9422d778bae5088f382 (patch) | |
tree | 0a9eef8179f9b3770bf5c1d3a7b096d623e0d715 /src/main.c | |
parent | 7144216342686b49e4f759c2fdd8de4946db8fdb (diff) |
Added reflection-caching support
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@8 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -27,6 +27,7 @@ #include "mrc.h" #include "qdrp.h" #include "ipr.h" +#include "cache.h" static gint main_method_window_response(GtkWidget *method_window, gint response, ControlContext *ctx) { @@ -51,11 +52,19 @@ static gint main_method_window_response(GtkWidget *method_window, gint response, gtk_widget_destroy(method_window); while ( gtk_events_pending() ) gtk_main_iteration(); - + if ( ctx->inputfiletype == INPUT_QDRP ) { val = qdrp_read(ctx); } else if ( ctx->inputfiletype == INPUT_MRC ) { val = mrc_read(ctx); + } else if ( ctx->inputfiletype == INPUT_CACHE ) { + ctx->reflectionctx = load_rctx_from_file(ctx->filename); + val=0; + } + + if (ctx->inputfiletype == INPUT_QDRP || ctx->inputfiletype == INPUT_MRC) { + printf("Saving reflection block to reflect.cache\n"); + save_rctx_to_file("reflect.cache",ctx->reflectionctx); } if ( !val && (ctx->rmode == RECONSTRUCTION_PREDICTION) ) { @@ -161,6 +170,9 @@ int main(int argc, char *argv[]) { } else if ( strcmp(filename+(strlen(filename)-4), ".mrc") == 0 ) { printf("MRC tomography file detected.\n"); ctx->inputfiletype = INPUT_MRC; + } else if (strcmp(filename, "reflect.cache") == 0 ) { + printf("reflect.cache detected.\n"); + ctx->inputfiletype = INPUT_CACHE; } else { fprintf(stderr, "Input file must either be an MRC tomography file or a QDRP-style control file.\n"); return 1; |