/* * itrans.c * * Parameterise features in an image for reconstruction * * (c) 2007 Thomas White * Gordon Ball * * dtr - Diffraction Tomography Reconstruction * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "control.h" #include "imagedisplay.h" #include "reflections.h" #include "itrans-threshold.h" #include "itrans-zaefferer.h" #include "itrans-lsq.h" #include "itrans-stat.h" void itrans_process_image(int16_t *image, ControlContext *ctx, double tilt_degrees) { unsigned int n_reflections; ImageDisplay *imagedisplay = NULL; ctx->first_image = 0; if ( ctx->first_image ) { imagedisplay = imagedisplay_open(image, ctx->width, ctx->height, "Image Display"); imagedisplay_add_tilt_axis(imagedisplay, ctx, ctx->omega); } switch ( ctx->psmode ) { case PEAKSEARCH_THRESHOLD : n_reflections = itrans_peaksearch_threshold(image, ctx, tilt_degrees, imagedisplay); break; case PEAKSEARCH_ADAPTIVE_THRESHOLD : n_reflections = itrans_peaksearch_adaptive_threshold(image, ctx, tilt_degrees, imagedisplay); break; case PEAKSEARCH_LSQ : n_reflections = itrans_peaksearch_lsq(image, ctx, tilt_degrees, imagedisplay); break; case PEAKSEARCH_ZAEFFERER : n_reflections = itrans_peaksearch_zaefferer(image, ctx, tilt_degrees, imagedisplay); break; case PEAKSEARCH_STAT : n_reflections = itrans_peaksearch_stat(image, ctx, tilt_degrees, imagedisplay); break; default: n_reflections = 0; } ctx->first_image = 0; }