/* * control.h * * Common control structure * * (c) 2007 Thomas White * * dtr - Diffraction Tomography Reconstruction * */ #ifdef HAVE_CONFIG_H #include #endif #ifndef CONTROL_H #define CONTROL_H #include #include #define MAX_IMAGES 256 typedef enum ift_enum { INPUT_NONE, INPUT_QDRP, INPUT_MRC, INPUT_CACHE } InputFileType; typedef enum { FORMULATION_CLEN, FORMULATION_PIXELSIZE } FormulationMode; typedef enum { PEAKSEARCH_NONE, PEAKSEARCH_THRESHOLD, PEAKSEARCH_ADAPTIVE_THRESHOLD, PEAKSEARCH_LSQ, PEAKSEARCH_ZAEFFERER, PEAKSEARCH_STAT } PeakSearchMode; typedef enum { RECONSTRUCTION_MAPPING, RECONSTRUCTION_PREDICTION } ReconstructionMode; typedef struct imagerecord_struct { uint16_t *image; double tilt; /* Degrees */ double omega; /* Degrees */ FormulationMode fmode; double pixel_size; double camera_len; double lambda; double resolution; int width; int height; int x_centre; int y_centre; } ImageRecord; typedef struct { int x; int y; double intensity; } ImageReflection; typedef struct cctx_struct { /* Modes */ InputFileType inputfiletype; FormulationMode fmode; ReconstructionMode rmode; PeakSearchMode psmode; unsigned int prealign; unsigned int savecache; unsigned int have_centres; /* Input filename */ char *filename; /* Basic parameters, stored here solely so they can be copied * into the ImageRecord(s) more easily */ double camera_length; double omega; /* Degrees */ double resolution; double lambda; double pixel_size; double x_centre; double y_centre; /* QDRP Parser flags */ unsigned int started; unsigned int camera_length_set; unsigned int omega_set; unsigned int resolution_set; unsigned int lambda_set; /* The input images */ int n_images; ImageRecord images[MAX_IMAGES]; /* Output */ struct rctx_struct *reflectionctx; /* GTK bits */ GtkWidget *combo_algorithm; GtkWidget *combo_peaksearch; GtkWidget *checkbox_prealign; GtkWidget *checkbox_savecache; } ControlContext; extern int control_add_image(ControlContext *ctx, uint16_t *image, int width, int height, double tilt); extern ControlContext *control_ctx_new(void); #endif /* CONTROL_H */