aboutsummaryrefslogtreecommitdiff
path: root/src/gui_peaksearch.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-24 10:05:24 +0200
committerThomas White <taw@physics.org>2020-09-24 10:05:24 +0200
commitbb3d1fe21d108fa0141358e67ced69202f700016 (patch)
treedcac6757c10dfd7a5aff06bbcbb4407997c44dd8 /src/gui_peaksearch.c
parent96e09f478d7cc4475999b53855b674dfb3a5f6cf (diff)
GUI: Always update peaks, even if they're not being displayed
"Index this frame" needs to make sure that peaks have been found, regardless of whether they're being displayed or not.
Diffstat (limited to 'src/gui_peaksearch.c')
-rw-r--r--src/gui_peaksearch.c117
1 files changed, 57 insertions, 60 deletions
diff --git a/src/gui_peaksearch.c b/src/gui_peaksearch.c
index 4f8f37d9..fa63d8fa 100644
--- a/src/gui_peaksearch.c
+++ b/src/gui_peaksearch.c
@@ -55,67 +55,64 @@ void update_peaks(struct crystfelproject *proj)
crystfel_image_view_set_peak_box_size(CRYSTFEL_IMAGE_VIEW(proj->imageview),
proj->peak_search_params.pk_inn);
- if ( proj->show_peaks ) {
-
- image_feature_list_free(proj->cur_image->features);
- proj->cur_image->features = NULL;
-
- switch ( proj->peak_search_params.method ) {
-
- case PEAK_ZAEF:
- search_peaks(proj->cur_image,
- proj->peak_search_params.threshold,
- proj->peak_search_params.min_sq_gradient,
- proj->peak_search_params.min_snr,
- proj->peak_search_params.pk_inn,
- proj->peak_search_params.pk_mid,
- proj->peak_search_params.pk_out,
- 1);
- break;
-
- case PEAK_PEAKFINDER8:
- search_peaks_peakfinder8(proj->cur_image, 2048,
- proj->peak_search_params.threshold,
- proj->peak_search_params.min_snr,
- proj->peak_search_params.min_pix_count,
- proj->peak_search_params.max_pix_count,
- proj->peak_search_params.local_bg_radius,
- proj->peak_search_params.min_res,
- proj->peak_search_params.max_res,
- 1);
- break;
-
- case PEAK_PEAKFINDER9:
- search_peaks_peakfinder9(proj->cur_image,
- proj->peak_search_params.min_snr_biggest_pix,
- proj->peak_search_params.min_snr_peak_pix,
- proj->peak_search_params.min_snr,
- proj->peak_search_params.min_sig,
- proj->peak_search_params.min_peak_over_neighbour,
- proj->peak_search_params.local_bg_radius);
- break;
-
- case PEAK_HDF5:
- case PEAK_CXI:
- proj->cur_image->features = image_read_peaks(proj->dtempl,
- proj->cur_image->filename,
- proj->cur_image->ev,
- proj->peak_search_params.half_pixel_shift);
- if ( proj->peak_search_params.revalidate ) {
- validate_peaks(proj->cur_image,
- proj->peak_search_params.min_snr,
- proj->peak_search_params.pk_inn,
- proj->peak_search_params.pk_mid,
- proj->peak_search_params.pk_out,
- 1, 0);
- }
- break;
-
- default:
- ERROR("This peak detection method not implemented!\n");
- break;
-
+ image_feature_list_free(proj->cur_image->features);
+ proj->cur_image->features = NULL;
+
+ switch ( proj->peak_search_params.method ) {
+
+ case PEAK_ZAEF:
+ search_peaks(proj->cur_image,
+ proj->peak_search_params.threshold,
+ proj->peak_search_params.min_sq_gradient,
+ proj->peak_search_params.min_snr,
+ proj->peak_search_params.pk_inn,
+ proj->peak_search_params.pk_mid,
+ proj->peak_search_params.pk_out,
+ 1);
+ break;
+
+ case PEAK_PEAKFINDER8:
+ search_peaks_peakfinder8(proj->cur_image, 2048,
+ proj->peak_search_params.threshold,
+ proj->peak_search_params.min_snr,
+ proj->peak_search_params.min_pix_count,
+ proj->peak_search_params.max_pix_count,
+ proj->peak_search_params.local_bg_radius,
+ proj->peak_search_params.min_res,
+ proj->peak_search_params.max_res,
+ 1);
+ break;
+
+ case PEAK_PEAKFINDER9:
+ search_peaks_peakfinder9(proj->cur_image,
+ proj->peak_search_params.min_snr_biggest_pix,
+ proj->peak_search_params.min_snr_peak_pix,
+ proj->peak_search_params.min_snr,
+ proj->peak_search_params.min_sig,
+ proj->peak_search_params.min_peak_over_neighbour,
+ proj->peak_search_params.local_bg_radius);
+ break;
+
+ case PEAK_HDF5:
+ case PEAK_CXI:
+ proj->cur_image->features = image_read_peaks(proj->dtempl,
+ proj->cur_image->filename,
+ proj->cur_image->ev,
+ proj->peak_search_params.half_pixel_shift);
+ if ( proj->peak_search_params.revalidate ) {
+ validate_peaks(proj->cur_image,
+ proj->peak_search_params.min_snr,
+ proj->peak_search_params.pk_inn,
+ proj->peak_search_params.pk_mid,
+ proj->peak_search_params.pk_out,
+ 1, 0);
}
+ break;
+
+ default:
+ ERROR("This peak detection method not implemented!\n");
+ break;
+
}
}