aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorgfb21 <gfb21@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-02-17 13:50:28 +0000
committergfb21 <gfb21@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-02-17 13:50:28 +0000
commite3bfcf077994c70aa965f9422d778bae5088f382 (patch)
tree0a9eef8179f9b3770bf5c1d3a7b096d623e0d715 /src/main.c
parent7144216342686b49e4f759c2fdd8de4946db8fdb (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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 7f5d5c9..d142441 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;