Files
Jungfraujoch/viewer/windows/JFJochScalingPanel.cpp
T
leonarski_f 75e401f0e5
Build Packages / Unit tests (push) Successful in 1h31m59s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 8m43s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m5s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m27s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m56s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m24s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 10m27s
Build Packages / build:rpm (rocky8) (push) Successful in 9m20s
Build Packages / build:rpm (rocky9) (push) Successful in 10m50s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m54s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m38s
Build Packages / DIALS test (push) Successful in 12m13s
Build Packages / XDS test (durin plugin) (push) Successful in 7m8s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 7m8s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m50s
Build Packages / Generate python client (push) Successful in 16s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Skipped
v1.0.0-rc.153 (#63)
This is an UNSTABLE release. It includes many experimental features, as well as many AI generated fixes. We recommend using rc.152 for production use.

* jfjoch_broker: Add EXPERIMENTAL pixelrefine mode for image processing
* jfjoch_broker: Allow to load user mask from 8-bit and 16-bit TIFF files
* jfjoch_broker: Add ROI calculation in non-FPGA workflow
* jfjoch_broker: Fixes to TCP image pusher
* jfjoch_broker: Remove NUMA bindings
* jfjoch_broker: Improvements to indexing
* jfjoch_broker: For PSI EIGER, trimming energies are taken from the detector configuration (now compulsory) instead of hardcoded values
* jfjoch_writer: Save ROI definitions and the per-pixel ROI bitmap in the master file; azimuthal ROIs support phi (angular) sectors
* jfjoch_viewer: Major redesign with dockable panels and saved layouts, plus on-canvas creation/move/resize of box, circle and azimuthal ROIs
* jfjoch_viewer: Run jfjoch_process reprocessing jobs from inside the GUI and overlay per-run results

Reviewed-on: #63
2026-06-23 20:29:49 +02:00

78 lines
3.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#include "JFJochScalingPanel.h"
#include <QCheckBox>
#include <QComboBox>
#include <QFormLayout>
#include <QGroupBox>
#include <QVBoxLayout>
JFJochScalingPanel::JFJochScalingPanel(const ScalingSettings &settings, QWidget *parent)
: QWidget(parent) {
auto *layout = new QVBoxLayout(this);
auto *group = new QGroupBox("Scaling && merging", this);
auto *form = new QFormLayout(group);
m_partiality = new QComboBox(this);
m_partiality->addItem("Fixed", static_cast<int>(PartialityModel::Fixed));
m_partiality->addItem("Rotation", static_cast<int>(PartialityModel::Rotation));
m_partiality->addItem("Unity", static_cast<int>(PartialityModel::Unity));
const auto pm = settings.GetPartialityModel().value_or(PartialityModel::Fixed);
if (const int idx = m_partiality->findData(static_cast<int>(pm)); idx >= 0)
m_partiality->setCurrentIndex(idx);
form->addRow("Partiality model", m_partiality);
m_mergeFriedel = new QCheckBox("Merge Friedel pairs", this);
m_mergeFriedel->setChecked(settings.GetMergeFriedel());
form->addRow("", m_mergeFriedel);
m_refineB = new QCheckBox("Refine per-image B-factor", this);
m_refineB->setChecked(settings.GetRefineB());
form->addRow("", m_refineB);
m_minPartiality = new SliderPlusBox(0.0, 1.0, 0.01, 2, this);
m_minPartiality->setValue(settings.GetMinPartiality());
form->addRow("Minimum partiality", m_minPartiality);
m_outlierNsigma = new SliderPlusBox(0.0, 10.0, 0.5, 1, this);
m_outlierNsigma->setValue(settings.GetOutlierRejectNsigma());
form->addRow("Outlier rejection [σ, 0 = off]", m_outlierNsigma);
m_limitResolution = new QCheckBox("Limit resolution", this);
m_limitResolution->setChecked(settings.GetHighResolutionLimit_A().has_value());
form->addRow("", m_limitResolution);
m_highRes = new SliderPlusBox(0.5, 5.0, 0.1, 1, this);
m_highRes->setValue(settings.GetHighResolutionLimit_A().value_or(2.0));
m_highRes->setEnabled(m_limitResolution->isChecked());
form->addRow("High-resolution limit [Å]", m_highRes);
layout->addWidget(group);
layout->addStretch();
connect(m_partiality, &QComboBox::currentIndexChanged, this, [this](int) { emitChanged(); });
connect(m_mergeFriedel, &QCheckBox::toggled, this, [this](bool) { emitChanged(); });
connect(m_refineB, &QCheckBox::toggled, this, [this](bool) { emitChanged(); });
connect(m_minPartiality, &SliderPlusBox::valueChanged, this, [this](double) { emitChanged(); });
connect(m_outlierNsigma, &SliderPlusBox::valueChanged, this, [this](double) { emitChanged(); });
connect(m_limitResolution, &QCheckBox::toggled, this, [this](bool checked) {
m_highRes->setEnabled(checked);
emitChanged();
});
connect(m_highRes, &SliderPlusBox::valueChanged, this, [this](double) { emitChanged(); });
}
void JFJochScalingPanel::emitChanged() {
ScalingSettings s;
s.SetPartialityModel(static_cast<PartialityModel>(m_partiality->currentData().toInt()));
s.MergeFriedel(m_mergeFriedel->isChecked());
s.RefineB(m_refineB->isChecked());
s.MinPartiality(m_minPartiality->value());
s.OutlierRejectNsigma(m_outlierNsigma->value());
if (m_limitResolution->isChecked())
s.HighResolutionLimit_A(m_highRes->value());
emit settingsChanged(s);
}