viewer: Phase 1c — fold per-image plot into the dataset-info dock

Remove the duplicated per-image plot from the side panel and host it in the
dataset-info dock instead:

- JFJochViewerDatasetInfo gains a "Per-image" toggle (next to Grid) that swaps
  the stacked view to the existing JFJochViewerSidePanelChart (azimuthal 1D,
  Wilson, I/sigma, spot and fluorescence profiles of the current image). The
  per-dataset metric combo is disabled while in per-image mode.
- The per-image profile follows the displayed image (imageLoaded forwarded).
- Drop the "Image statistics plot" section from JFJochViewerSidePanel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 16:26:15 +02:00
co-authored by Claude Opus 4.8
parent 54526300a9
commit e7edee6b2e
4 changed files with 41 additions and 20 deletions
+35 -8
View File
@@ -42,18 +42,25 @@ JFJochViewerDatasetInfo::JFJochViewerDatasetInfo(QWidget *parent) : QWidget(pare
grid_button->setCheckable(true);
grid_button->setEnabled(false);
image_button = new QPushButton("Per-image", this);
image_button->setFixedWidth(100);
image_button->setCheckable(true);
layout->addWidget(reset_button, 0, 2);
layout->addWidget(grid_button, 0, 3);
layout->addWidget(image_button, 0, 4);
stack = new QStackedWidget(this);
chart_view = new JFJochDatasetInfoChartView(this);
chart_view->setMinimumHeight(80); // low floor so the bottom dock resizes freely (default is set via resizeDocks)
grid_scan_image = new JFJochGridScanImage(this);
image_chart = new JFJochViewerSidePanelChart(this); // per-image profiles, folded in from the side panel
stack->addWidget(chart_view);
stack->addWidget(grid_scan_image);
stack->addWidget(image_chart);
layout->addWidget(stack, 1, 0, 1, 4);
layout->addWidget(stack, 1, 0, 1, 5);
connect(chart_view, &JFJochDatasetInfoChartView::imageSelected,
this, &JFJochViewerDatasetInfo::imageSelectedInChart);
@@ -79,11 +86,21 @@ JFJochViewerDatasetInfo::JFJochViewerDatasetInfo(QWidget *parent) : QWidget(pare
connect(grid_button, &QPushButton::clicked,
[this]() {
if (grid_button->isChecked() && dataset && dataset->experiment.GetGridScan())
stack->setCurrentWidget(grid_scan_image);
else
stack->setCurrentWidget(chart_view);
if (grid_button->isChecked()) {
image_button->setChecked(false);
combo_box->setEnabled(true);
}
UpdateView();
});
connect(image_button, &QPushButton::clicked,
[this]() {
if (image_button->isChecked())
grid_button->setChecked(false);
combo_box->setEnabled(!image_button->isChecked()); // the metric combo is for the dataset plot
UpdateView();
});
connect(image_chart, &JFJochViewerSidePanelChart::writeStatusBar,
[this](QString s, int t) { emit writeStatusBar(s, t); });
setLayout(layout);
}
@@ -167,6 +184,7 @@ void JFJochViewerDatasetInfo::imageLoaded(std::shared_ptr<const JFJochReaderImag
chart_view->setImage(image->ImageData().number);
grid_scan_image->setImage(image->ImageData().number);
}
image_chart->loadImage(image); // per-image profile follows the displayed image
}
void JFJochViewerDatasetInfo::imageSelectedInChart(int64_t number) {
@@ -262,15 +280,24 @@ void JFJochViewerDatasetInfo::UpdatePlot() {
std::move(overlays), primary_color, XForRun(*dataset), full_range);
if (dataset->experiment.GetGridScan()) {
stack->setCurrentWidget(grid_scan_image);
grid_scan_image->loadData(data, dataset->experiment.GetGridScan().value(), one_over_d2);
grid_button->setEnabled(true);
grid_button->setChecked(true);
if (!image_button->isChecked())
grid_button->setChecked(true);
} else {
grid_scan_image->clear();
stack->setCurrentWidget(chart_view);
grid_button->setEnabled(false);
}
UpdateView();
}
void JFJochViewerDatasetInfo::UpdateView() {
if (image_button->isChecked())
stack->setCurrentWidget(image_chart);
else if (grid_button->isChecked() && dataset && dataset->experiment.GetGridScan())
stack->setCurrentWidget(grid_scan_image);
else
stack->setCurrentWidget(chart_view);
}
void JFJochViewerDatasetInfo::runsChanged(QVector<RunData> runs, QString active_id) {