reader/viewer: snapshot image->original map; subset runs register and overlay

Foundation for a dataset (snapshot or, later, the main file) being a subset of the
truly collected images:
- JFJochReaderDataset gains source_image_number (image index -> original image
  number; empty = identity).
- HDF5MetadataSource reads /entry/detector/number into that map and an inverse
  (original -> local) map; FillPerImage / ReadSpots translate the requested global
  image to this source's local index via ToLocalIndex (return nothing if the image
  is not covered), so partial snapshots are correct and never read out of bounds.
- RegisterSnapshot now accepts a snapshot with fewer images than the dataset
  (only rejects more), so sub-range / strided reprocessing runs register.
- The dataset-info plot draws each run at its original image numbers (x map from
  source_image_number), so a subset run lands at the right place on the shared
  axis. The live run's map is filled from msg.original_number.

This makes the foundation ready for strided / filtered selections (e.g. reprocess
only images with >N spots) without restricting to a min-max sub-range.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 14:59:23 +02:00
co-authored by Claude Opus 4.8
parent 7ba097df1c
commit b9f8c2b675
8 changed files with 96 additions and 22 deletions
+4
View File
@@ -101,6 +101,10 @@ void JFJochProcessController::OnImageProcessed(const DataMessage &msg) {
v[i] = val;
};
auto &d = *live_dataset_;
// Map this ordinal back to its original image number (for the x-axis of subset/strided runs).
if (static_cast<int64_t>(d.source_image_number.size()) <= i)
d.source_image_number.resize(i + 1, 0);
d.source_image_number[i] = static_cast<int>(msg.original_number.value_or(msg.number));
if (msg.spot_count) put(d.spot_count, *msg.spot_count);
if (msg.spot_count_indexed) put(d.spot_count_indexed, *msg.spot_count_indexed);
if (msg.spot_count_low_res) put(d.spot_count_low_res, *msg.spot_count_low_res);