From 51869a2add34248f132ab994da9ffca8df854c61 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 24 Nov 2025 12:01:58 +0100 Subject: [PATCH] jfjoch_viewer: Resolution estimation is the main mode for diffraction rings --- viewer/image_viewer/JFJochDiffractionImage.cpp | 5 ++++- viewer/image_viewer/JFJochDiffractionImage.h | 2 +- viewer/widgets/ResolutionRingWidget.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/viewer/image_viewer/JFJochDiffractionImage.cpp b/viewer/image_viewer/JFJochDiffractionImage.cpp index caf8d028..a4367f96 100644 --- a/viewer/image_viewer/JFJochDiffractionImage.cpp +++ b/viewer/image_viewer/JFJochDiffractionImage.cpp @@ -188,7 +188,10 @@ void JFJochDiffractionImage::DrawResolutionRings() { else res_ring = {}; } else if (ring_mode == RingMode::Estimation) { - if (image && image->ImageData().resolution_estimate) + if (image + && image->ImageData().resolution_estimate + && std::isfinite(image->ImageData().resolution_estimate.value()) + && image->ImageData().resolution_estimate.value() > 0.0) res_ring = {*image->ImageData().resolution_estimate}; else res_ring = {}; diff --git a/viewer/image_viewer/JFJochDiffractionImage.h b/viewer/image_viewer/JFJochDiffractionImage.h index c792f06f..b271c463 100644 --- a/viewer/image_viewer/JFJochDiffractionImage.h +++ b/viewer/image_viewer/JFJochDiffractionImage.h @@ -36,7 +36,7 @@ private: QVector res_ring = {}; - RingMode ring_mode = RingMode::Manual; + RingMode ring_mode = RingMode::Estimation; bool show_spots = false; bool show_predictions = false; diff --git a/viewer/widgets/ResolutionRingWidget.cpp b/viewer/widgets/ResolutionRingWidget.cpp index 1659e753..b6f7f380 100644 --- a/viewer/widgets/ResolutionRingWidget.cpp +++ b/viewer/widgets/ResolutionRingWidget.cpp @@ -19,7 +19,7 @@ ResolutionRingWidget::ResolutionRingWidget(QWidget *parent) manual_button = new QRadioButton("Manual", this); est_button = new QRadioButton("Resolution estimation from processing", this); - none_button->setChecked(true); + est_button->setChecked(true); button_group = new QButtonGroup(this); button_group->addButton(none_button, 0);