viewer: TEMPORARY STUB - the grid-scan composite reads protein, ice and the crystal list from a local placeholder

REVERT THIS COMMIT AT INTEGRATION. protein_score, ice_score and the grid-scan
crystal list are not on JFJochReaderDataset yet; they arrive through reader/
with a separate change. Until then GridScanDataStub.h defines GridScanCrystal
and three accessors that return nothing, so the widget and the dataset-info
panel are already written against the real shape of the data and compile today.

Reverting this commit leaves exactly the two includes and the CMake entry to
replace: take GridScanCrystal from the reader, and the three accessors become
ds.protein_score, ds.ice_score and ds.grid_scan_result at their call sites in
JFJochViewerDatasetInfo.cpp. Nothing else changes - both data paths fill the
same JFJochReaderDataset, so HTTP and HDF5 light up together.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
leonarski_fandClaude Opus 5 committed 2026-09-08 00:00:13 +02:00
1 parent 0c6167b7c5
commit cd31747c99
4 files changed
+59

No files matched your search

+1
View File
@@ -104,6 +104,7 @@ ADD_EXECUTABLE(jfjoch_viewer jfjoch_viewer.cpp JFJochViewerWindow.cpp JFJochView
image_viewer/JFJochGridScanImage.cpp
image_viewer/JFJochGridScanImage.h
image_viewer/GridScanComposite.h
GridScanDataStub.h
widgets/PowderCalibrationWidget.cpp
widgets/PowderCalibrationWidget.h
${APP_RESOURCES}
+56
View File
@@ -0,0 +1,56 @@
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <vector>
#include "../reader/JFJochReaderDataset.h"
// ===========================================================================================
// STUB - DELETE THIS FILE AT INTEGRATION.
//
// The composite grid-scan map is drawn from the per-image protein and ice scores and from the
// crystal list of the whole raster. None of the three is on JFJochReaderDataset yet; they arrive
// with a separate change, through reader/. Until then this header is the one place in the viewer
// that names them, so the widget and the dataset-info panel are already written against the real
// shape of the data.
//
// At integration: drop this file and its two includes (image_viewer/JFJochGridScanImage.h and
// JFJochViewerDatasetInfo.cpp), take GridScanCrystal from the reader instead, and replace the three
// accessors below with `ds.protein_score`, `ds.ice_score` and `ds.grid_scan_result` at their call
// sites in JFJochViewerDatasetInfo.cpp. Nothing else has to change: both data paths (HTTP and HDF5)
// fill the same JFJochReaderDataset, so both light up at once.
// ===========================================================================================
// One crystal found in a grid scan. Position and extent are in the grid's own frame; the extent is
// along the crystal's own principal axes, which is why angle_deg is needed to draw it.
struct GridScanCrystal {
float nx = 0; // centre, fractional grid coordinates, 0-based
float ny = 0;
float x_um = 0; // centre, signed offset along the grid axes
float y_um = 0;
int64_t image_number = -1;
float major_um = 0; // extent along the crystal's own principal axes
float minor_um = 0;
float angle_deg = 0; // major axis from +x grid axis, counter-clockwise, in [0, 180)
float score = 0;
float ice_score = 0;
float res_A = 0;
int64_t n_images = 0;
};
inline const std::vector<float> &GridScanProteinScore(const JFJochReaderDataset &) {
static const std::vector<float> none;
return none;
}
inline const std::vector<float> &GridScanIceScore(const JFJochReaderDataset &) {
static const std::vector<float> none;
return none;
}
inline const std::vector<GridScanCrystal> &GridScanCrystals(const JFJochReaderDataset &) {
static const std::vector<GridScanCrystal> none;
return none;
}
+1
View File
@@ -6,6 +6,7 @@
#include <QColor>
#include "JFJochViewerDatasetInfo.h"
#include "GridScanDataStub.h" // STUB - see the note in that file
namespace {
// Stable colour per run by its position in the run list (Original is index 0 -> blue), so a
@@ -5,6 +5,7 @@
#include "JFJochImage.h"
#include "GridScanComposite.h"
#include "../GridScanDataStub.h" // STUB: GridScanCrystal - see the note in that file
#include "../../reader/JFJochReaderDataset.h"
Q_DECLARE_METATYPE(GridScanSettings)