Commit Graph

10 Commits

Author SHA1 Message Date
leonarski_f c86beeb393 rotation indexer: fix sub-range crash, explicit angle, settings + guards
Running rotation indexing on a sub-range (e.g. images 60-120) segfaulted: the
first pass passed the *global* image number to RotationIndexer::ProcessImage,
which indexes v_ (sized to the run's image count) -> out-of-bounds write.

- ProcessImage now takes an explicit mid-exposure angle (optional; falls back to
  the goniometer at the image index), so the indexer no longer assumes its slot
  index equals the goniometer image index. IndexAndRefine supplies it via
  RotationAngle(), matching the angle used for prediction. Added a bounds guard in
  ProcessImage so a bad index can never corrupt memory.
- JFJochProcess feeds the rotation indexer the local ordinal (not the global
  index), and shifts the goniometer (start += start_image*incr, incr *= stride,
  per-image wedge preserved) so local index i maps to the angle of original image
  start+i*stride - fixing rotation angles for the whole sub-range pipeline
  (prediction, refinement, output), not just the indexer.
- Expose "Rotation images" (number used for the first pass) in the job dialog,
  enabled when rotation indexing is on. (Count > available is already clamped by
  select_equally_spaced_image_ordinals.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:59:21 +02:00
leonarski_f 67ad43a2b2 viewer: palette theming, Original as a run row, stable plot colours
Styling (now via the application palette in main(), not a stylesheet, so it
applies to every widget incl. dialogs):
- Entry fields and item views (line edits, spin boxes, combos, tables) are white
  when enabled and salmon (the GUI default) when disabled - so it's clear where
  you can type. Panels stay salmon (Window role).
- Teal (#2a9d8f) accent via the Highlight role: selections and progress-bar chunks.

Runs list / plots:
- The original file is listed as a first "Original" run (Mode "HDF5"); double-click
  any run row to show it (replaces the "Show original" button). The currently shown
  run is bold (driven by snapshotsChanged).
- Fix the colour "swap" when switching runs: the primary line is matched by the
  active-dataset pointer (not active_id_), so a run keeps its colour even while a
  datasetLoaded/runsChanged pair is mid-flight.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:34:06 +02:00
leonarski_f 03a09c43bc viewer: white-when-active inputs, teal accent, Status column visible
Styling:
- Entry widgets (line edits, spin boxes, combos, item views) are salmon (the GUI
  default) when inactive and turn white while focused/active.
- A teal accent (#2a9d8f) for selections and the QProgressBar chunk, against the
  salmon background.
- Move the jobs-table Status column (the progress bar) to column 2 so it stays
  visible in the narrow dock instead of scrolling off the right edge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:10:36 +02:00
leonarski_f 0f3009069f viewer: processing dialog takes start + end image, not a count
Replace the ambiguous "Images" count with explicit "Start image" and "End image"
spinboxes (end 0 = to the last image). buildConfig sets config.start_image /
end_image; the table shows the range ("start-end" / "all") and the progress bar
expects end-start images.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:01:25 +02:00
leonarski_f 7ba097df1c viewer: looser minimum heights so the bottom docks resize freely
Lower the dataset-info chart and jobs-table minimum heights (200 -> 80, table 60)
so the bottom dock area can be dragged smaller; the comfortable default size is
still set via resizeDocks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:24:47 +02:00
leonarski_f 2af822436e viewer: remove/clear runs, stable per-run colours, processing rate + ETA
- "Remove result" toolbar action drops a reprocessing run: reader RemoveSnapshot
  (Original is protected; if the removed run was active the view falls back to
  Original), worker RemoveRun, and the table row is removed.
- Opening a new file clears the jobs table (worker fileOpened -> clearJobs) to
  match the reader, which already resets snapshots on ReadFile.
- Plot fixes: each run keeps a stable colour by its position (Original = blue),
  so colours no longer swap when the active run changes; the current-image marker
  is hidden from the legend (was the stray "[Image #N]" entry).
- The status bar shows processing rate (Hz) and estimated remaining time while a
  job runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:00:15 +02:00
leonarski_f aceff23ce2 viewer: overlay one plot line per processing run (with editable names)
The dataset-info plot now overlays every run as a separate named line instead of
replacing the plot when a snapshot is activated:

- Reader gains AllSnapshotDatasets() (every snapshot's dataset, Original first).
- The worker owns the run collection: a stable snapshot id plus an editable
  display label (RunData), emitted as runsChanged(runs, active_id) on file open,
  snapshot register, activate and rename. RenameRun(id, label) updates the legend
  label without touching the reader key (decoupled id vs label).
- The chart view draws the active run as the primary series (markers, hover,
  binning, axes) and the other runs as overlay lines sharing its axes, with a
  legend shown when overlaying (appendSeries factored out for both).
- The dataset-info widget holds the run list + the live run, extracts the selected
  metric from each (ExtractMetric), and unions the available metrics across runs.
- The live run is its own "Live" overlay (lightweight per-tick refresh, no combo
  rebuild); it is cleared on finish so the persisted snapshot takes over.
- The processing jobs table gets a "Started" column and an editable Name column;
  editing a name renames that run's legend label.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 11:28:47 +02:00
leonarski_f 9c417d322f viewer: dock the processing panel next to the plots; HTTP-mode notice
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 13m56s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 14m27s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 14m48s
Build Packages / build:rpm (rocky8) (push) Successful in 14m42s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 15m10s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 15m24s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 15m43s
Build Packages / XDS test (durin plugin) (push) Successful in 8m31s
Build Packages / Generate python client (push) Successful in 31s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 9m21s
Build Packages / Create release (push) Skipped
Build Packages / XDS test (neggia plugin) (push) Successful in 9m7s
Build Packages / Build documentation (push) Successful in 1m6s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 10m52s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 12m32s
Build Packages / build:rpm (rocky9) (push) Successful in 13m28s
Build Packages / DIALS test (push) Successful in 13m11s
Build Packages / Unit tests (push) Successful in 1h0m24s
- Convert JFJochProcessingJobsWindow from a standalone helper window into a
  dockable QWidget panel (toolbar + stacked table/message), placed in the bottom
  dock area and split horizontally to sit in the bottom-right corner next to the
  dataset-info plots. Its show/hide toggle moves to the Window menu via the new
  JFJochViewerMenu::AddDockEntry.
- When connected to a live HTTP stream the panel shows "Dataset re-processing is
  currently available only in File mode" and disables the toolbar, driven by the
  worker's httpConnectionChanged signal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 08:35:56 +02:00
leonarski_f 940b7e34d4 viewer: indexing algorithm/refinement radio groups, rotation fix, live job plots
Processing settings:
- Split the spot/index settings widget into two tabs (Spot finding | Indexing)
  via TakeSpotFindingPage()/TakeIndexingPage().
- Indexing tab now exposes the indexing algorithm (Auto/FFBIDX/FFT/FFTW/None) and
  geometry refinement (None/Orientation/Beam center/Pixel refine) as radio groups
  with short explanations.
- Fix: UpdateSpotFindingSettings dropped algorithm + geometry-refinement when
  copying into indexing_settings (the geom checkbox was a no-op); both now flow
  into jobs via curr_experiment.

Processing jobs window:
- Rotation indexing from the job dialog now also sets RotationIndexing(true) on
  the experiment's IndexingSettings; otherwise IndexAndRefine builds no rotation
  indexer and the two-pass pre-pass throws.
- Status cell shows a QProgressBar with "<done> / <expected>".
- Live results: JFJochProcessController::OnImageProcessed accumulates per-image
  results into a JFJochReaderDataset and emits it throttled (~4 Hz) as liveDataset,
  forwarded to the dataset-info plots so they update while a job runs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 08:30:49 +02:00
leonarski_f 5bfa70c4a6 viewer: Processing jobs window - run jfjoch_process in-GUI + result snapshots
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 13m40s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 13m50s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 14m48s
Build Packages / build:rpm (rocky8) (push) Successful in 14m55s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 15m0s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 15m11s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 15m27s
Build Packages / XDS test (durin plugin) (push) Successful in 9m9s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 9m18s
Build Packages / XDS test (neggia plugin) (push) Successful in 8m56s
Build Packages / Create release (push) Skipped
Build Packages / Generate python client (push) Successful in 29s
Build Packages / Build documentation (push) Successful in 1m8s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 11m6s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 12m50s
Build Packages / build:rpm (rocky9) (push) Successful in 13m23s
Build Packages / DIALS test (push) Successful in 13m13s
Build Packages / Unit tests (push) Successful in 1h28m58s
Makes the viewer a processing frontend, not just an image viewer:

- JFJochProcessingJobsWindow (menu "Processing"): a table of processing jobs on the open
  dataset. "New job" configures mode (full/azint), image count, threads, output, and (full)
  rotation indexing + scale/merge, using the viewer's current processing settings. A job can
  be Run locally (off the GUI thread via JFJochProcessController, with live status/progress and
  Cancel) or its jfjoch_process command line copied for a cluster.
- A finished local run is registered as a reader metadata snapshot and becomes the active
  dataset (bottom plots + per-image overlays follow it); "View results" / "Show original" switch
  between runs - so several settings attempts on one dataset can be compared.
- JFJochImageReadingWorker gains GetReprocessingInputs() (one locked read of file + experiment +
  mask + spot-finding settings, so jobs share the interactive settings) and
  RegisterProcessingSnapshot/SetActiveSnapshot slots + snapshotsChanged signal over the reader's
  snapshot API. Files only (not live HTTP).

First-cut / open ends: one job at a time; output lands in the working dir (FileWriter rejects
absolute prefixes); Bragg/scaling settings still use defaults until the converged settings
window lands. Viewer builds and runs (offscreen) cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 14:38:17 +02:00