aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-03 14:01:12 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-03 14:01:12 +0000
commit585ca628920b5eba3f6addddabcec9ca90527f19 (patch)
treea1c4d5735ed59e2af08f238e2d827c822728145f /src/main.c
parent80828d43d4959122c549be8e44b26815bdb61519 (diff)
UI and reprojection stuff
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@144 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/src/main.c b/src/main.c
index f80da7e..1a93483 100644
--- a/src/main.c
+++ b/src/main.c
@@ -37,22 +37,16 @@
void main_do_reconstruction(ControlContext *ctx) {
- int val = 0;
-
if ( (ctx->inputfiletype != INPUT_CACHE) && (ctx->inputfiletype != INPUT_DRX) ) {
prealign_sum_stack(ctx);
mapping_create(ctx);
}
- if ( (ctx->inputfiletype != INPUT_CACHE) && !val && ctx->reflectionlist && ctx->savecache ) {
+ if ( (ctx->inputfiletype != INPUT_CACHE) && ctx->reflectionlist && ctx->savecache ) {
cache_save(ctx->filename, ctx->reflectionlist);
}
- if ( (ctx->rmode == RECONSTRUCTION_PREDICTION) && (ctx->reflectionlist) ) {
- val = ipr_refine(ctx);
- }
-
- if ( !val && (ctx->reflectionlist) ) {
+ if ( ctx->reflectionlist ) {
ctx->dw = displaywindow_open(ctx);
} else {
fprintf(stderr, "Reconstruction failed.\n");
@@ -67,12 +61,6 @@ static gint main_method_window_response(GtkWidget *method_window, gint response,
int val = 0;
- switch ( gtk_combo_box_get_active(GTK_COMBO_BOX(ctx->combo_algorithm)) ) {
- case 0 : ctx->rmode = RECONSTRUCTION_MAPPING; break;
- case 1 : ctx->rmode = RECONSTRUCTION_PREDICTION; break;
- default: abort();
- }
-
switch ( gtk_combo_box_get_active(GTK_COMBO_BOX(ctx->combo_peaksearch)) ) {
case 0 : ctx->psmode = PEAKSEARCH_THRESHOLD; break;
case 1 : ctx->psmode = PEAKSEARCH_ADAPTIVE_THRESHOLD; break;
@@ -135,7 +123,6 @@ void main_method_dialog_open(ControlContext *ctx) {
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *table;
- GtkWidget *method_label;
GtkWidget *peaksearch_label;
method_window = gtk_dialog_new_with_buttons("Reconstruction Parameters", NULL,
@@ -146,21 +133,11 @@ 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, FALSE, 10);
- table = gtk_table_new(4, 2, FALSE);
+ table = gtk_table_new(3, 2, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(table), 5);
-
- method_label = gtk_label_new("Reconstruction Algorithm: ");
- gtk_table_attach_defaults(GTK_TABLE(table), method_label, 1, 2, 1, 2);
- gtk_misc_set_alignment(GTK_MISC(method_label), 1, 0.5);
- ctx->combo_algorithm = gtk_combo_box_new_text();
- gtk_combo_box_append_text(GTK_COMBO_BOX(ctx->combo_algorithm), "Feature Detection and Mapping");
- gtk_combo_box_append_text(GTK_COMBO_BOX(ctx->combo_algorithm), "Iterative Prediction and Refinement");
- gtk_combo_box_set_active(GTK_COMBO_BOX(ctx->combo_algorithm), 1);
- gtk_table_attach_defaults(GTK_TABLE(table), ctx->combo_algorithm, 2, 3, 1, 2);
- gtk_table_set_row_spacing(GTK_TABLE(table), 1, 5);
peaksearch_label = gtk_label_new("Peak Search: ");
- gtk_table_attach_defaults(GTK_TABLE(table), peaksearch_label, 1, 2, 2, 3);
+ gtk_table_attach_defaults(GTK_TABLE(table), peaksearch_label, 1, 2, 1, 2);
gtk_misc_set_alignment(GTK_MISC(peaksearch_label), 1, 0.5);
ctx->combo_peaksearch = gtk_combo_box_new_text();
gtk_combo_box_append_text(GTK_COMBO_BOX(ctx->combo_peaksearch), "Simple Thresholding");
@@ -169,13 +146,13 @@ void main_method_dialog_open(ControlContext *ctx) {
gtk_combo_box_append_text(GTK_COMBO_BOX(ctx->combo_peaksearch), "Zaefferer Gradient Search");
gtk_combo_box_append_text(GTK_COMBO_BOX(ctx->combo_peaksearch), "Iterative Statistical Analysis");
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);
+ gtk_table_attach_defaults(GTK_TABLE(table), ctx->combo_peaksearch, 2, 3, 1, 2);
ctx->checkbox_prealign = gtk_check_button_new_with_label("Pre-align image stack");
- gtk_table_attach_defaults(GTK_TABLE(table), ctx->checkbox_prealign, 1, 3, 3, 4);
+ gtk_table_attach_defaults(GTK_TABLE(table), ctx->checkbox_prealign, 1, 3, 2, 3);
ctx->checkbox_savecache = gtk_check_button_new_with_label("Save 3D mapping cache file");
- gtk_table_attach_defaults(GTK_TABLE(table), ctx->checkbox_savecache, 1, 3, 4, 5);
+ gtk_table_attach_defaults(GTK_TABLE(table), ctx->checkbox_savecache, 1, 3, 3, 4);
if ( ctx->inputfiletype == INPUT_CACHE ) {
gtk_combo_box_append_text(GTK_COMBO_BOX(ctx->combo_peaksearch), "3D coordinates from cache file");
@@ -187,7 +164,7 @@ void main_method_dialog_open(ControlContext *ctx) {
gtk_widget_set_sensitive(GTK_WIDGET(ctx->combo_peaksearch), FALSE);
gtk_combo_box_set_active(GTK_COMBO_BOX(ctx->combo_peaksearch), 5);
}
-
+
gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(table), TRUE, TRUE, 5);
g_signal_connect(G_OBJECT(method_window), "response", G_CALLBACK(main_method_window_response), ctx);
@@ -201,7 +178,6 @@ int main(int argc, char *argv[]) {
char *filename;
ControlContext *ctx;
- InputFileType type;
struct stat stat_buffer;
FILE *fh;
@@ -224,7 +200,6 @@ int main(int argc, char *argv[]) {
filename = argv[1];
ctx = control_ctx_new();
- type = INPUT_NONE;
fh = fopen(filename, "r");
if ( !fh ) {
@@ -251,7 +226,6 @@ int main(int argc, char *argv[]) {
}
ctx->filename = strdup(argv[1]);
- ctx->n_images = 0;
if ( stat(argv[1], &stat_buffer) == -1 ) {
fprintf(stderr, "File '%s' not found\n", argv[1]);