diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-03-31 00:19:35 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-03-31 00:19:35 +0000 |
commit | 8810e9ff13e9fb0db420dbdc529ef2f9dfe89d7c (patch) | |
tree | f256152050817b789554e0d18974fafcfbdf9644 /src/main.c | |
parent | 3db95bb6d650a56eefd8c6d7dbd6bdc57e0e2350 (diff) |
Fussiness:
Disable choice of peak detection algorithm when cached reflections used
Fix formatting and namespace convention in cache.{c,h}
Prevent reading beyond bounds of Reflection struct when saving cache
Handle caching when no reflections were found
(Temporarily?) disable octtree hooks
Tweak some credits anad syntax message
Other (mostly trivial) tweaks
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@15 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -4,6 +4,8 @@ * The Top Level Source File * * (c) 2007 Thomas White <taw27@cam.ac.uk> + * Gordon Ball <gfb21@cam.ac.uk> + * * dtr - Diffraction Tomography Reconstruction * */ @@ -59,21 +61,20 @@ static gint main_method_window_response(GtkWidget *method_window, gint response, } else if ( ctx->inputfiletype == INPUT_MRC ) { val = mrc_read(ctx); } else if ( ctx->inputfiletype == INPUT_CACHE ) { - ctx->reflectionctx = load_rctx_from_file(ctx->filename); + ctx->reflectionctx = cache_load(ctx->filename); val=0; } - if (ctx->inputfiletype == INPUT_QDRP || ctx->inputfiletype == INPUT_MRC) { + if ( ctx->inputfiletype != INPUT_CACHE ) { printf("Saving reflection block to reflect.cache\n"); - save_rctx_to_file("reflect.cache",ctx->reflectionctx); + cache_save("reflect.cache", ctx->reflectionctx); } - if ( !val && (ctx->rmode == RECONSTRUCTION_PREDICTION) ) { val = ipr_reduce(ctx); } - dump_histogram(ctx->reflectionctx); + //dump_histogram(ctx->reflectionctx); if ( val == 0 ) { displaywindow_open(ctx); @@ -130,6 +131,10 @@ void main_method_dialog_open(ControlContext *ctx) { gtk_combo_box_append_text(GTK_COMBO_BOX(ctx->combo_peaksearch), "Iterative Statistical"); gtk_combo_box_set_active(GTK_COMBO_BOX(ctx->combo_peaksearch), 3); gtk_table_attach_defaults(GTK_TABLE(table), ctx->combo_peaksearch, 2, 3, 2, 3); + + if ( ctx->inputfiletype == INPUT_CACHE ) { + gtk_widget_set_sensitive(GTK_WIDGET(ctx->combo_peaksearch), FALSE); + } gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(table), TRUE, TRUE, 5); @@ -160,7 +165,7 @@ int main(int argc, char *argv[]) { } if ( argc != 2 ) { - fprintf(stderr, "Syntax: %s [<MRC file> | qdrp.rc]\n", argv[0]); + fprintf(stderr, "Syntax: %s [<MRC file> | qdrp.rc | reflect.cache]\n", argv[0]); return 1; } @@ -174,11 +179,11 @@ 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 ) { + } 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"); + fprintf(stderr, "Unrecognised input file type\n"); return 1; } ctx->filename = strdup(argv[1]); |