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
57 lines
2.4 KiB
C++
57 lines
2.4 KiB
C++
// 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;
|
|
}
|