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>
The two capabilities that set Jungfraujoch apart get prominent, paired navy
buttons at the right of the display toolbar, with purpose-drawn icons (a single
diffraction frame vs a stack of frames):
- "Reanalyze image" re-runs the analysis pipeline on the current image
(worker Analyze).
- "Reanalyze dataset" opens a new whole-dataset processing job
(JFJochProcessingJobsWindow::newJob, now public).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Show the PSI logo in the menu-bar corner, picking one of four interchangeable
dot designs at random each launch. Embedded as PNGs (rasterised from the SVG
sources, kept alongside) so no Qt SVG module dependency is needed.
- Settings dock: put beam center X and Y on a single "Beam center" row to save
vertical space on laptop screens.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Surface a surgical subset of processing settings in an always-visible dock
instead of hidden windows:
- New JFJochViewerSettingsDock with an MX / AzInt segmented toggle.
MX page: geometry (energy, distance, beam X/Y), a new unit-cell +
space-group editor (no such input existed before; enables known-cell
ffbidx), spot finding (S/N, photon count, min pixels/spot), indexing
algorithm and geometry refinement. AzInt page: q range / spacing /
azimuthal bins plus the existing powder-calibration widget.
- Edits feed straight into the worker (UpdateSpotFindingSettings,
UpdateAzintSettings, UpdateDataset, FindCenter); fields populate from the
loaded dataset.
- Add CeO2 and Silicon calibrant presets.
- Dock it left, objectName "settingsDock", show it in the Processing
perspective (hidden in Image).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make the layout reconfigurable, the foundation for the redesign:
- The diffraction image becomes the central widget; the right-hand side panel
is now a dockable "Inspector" (QDockWidget, right area).
- Every dock and toolbar gets a stable objectName so QMainWindow saveState /
restoreState round-trips. Dataset-info docks are numbered uniquely.
- Persist geometry + dock state to QSettings on close and restore on launch,
so the user's arrangement resumes.
- New "View" menu with Image / Processing perspectives (show/hide the bottom
plots + jobs panel) and "Reset layout" (back to the as-built arrangement,
captured at startup).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
First pass of the viewer redesign (see docs/review/VIEWER_REDESIGN.md), no
structural change:
- TitleLabel: replace the 50px solid #FA7268 section bars with a slim 26px
navy-bold header + coral accent rule, removing the "venetian blind" stack
while keeping the salmon identity.
- Palette: switch the accent (QPalette::Highlight) from teal to navy #1F3A5F.
- Image toolbar: replace the unicode arrow glyphs (|<= <= => =>|) with flat
media icons (first/prev/next/last) + tooltips, and a play icon on Movie.
- Bottom dock: give the per-dataset plot more default height (340 -> 420).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Fusion fills QGroupBox interiors with a flat light colour, so the settings window
lost its salmon look. A tiny app stylesheet (QGroupBox { background: transparent })
makes them show the salmon window background again; entry widgets stay white via
the palette.
- The dataset-info chart now fixes the x-axis to the whole dataset [0, n) (the
largest run = the original file), so a subset run is drawn at its real image
positions instead of being stretched to fill the plot. Subsets with binning bin
by ordinal and place each point at its mapped image number (correct for the
common contiguous sub-range).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
The current-image marker (a scatter series) was picking an arbitrary theme colour
(green), which read as a stray series. Pin it to black so it's an unambiguous
"current image" dot, distinct from the run line colours. Its legend entry is
already hidden.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- "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>
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>
- The Indexing tab now shows what the selected algorithm resolves to on this
machine/dataset ("Effective on this system: ..."), mirroring
DiffractionExperiment::GetIndexingAlgorithm() so Auto is no longer ambiguous
(GPU present? unit cell known?). Cell-known state is forwarded from the loaded
dataset via JFJochSettingsWindow::datasetLoaded.
- FFBIDX and FFT (GPU) radio options are disabled on builds without CUDA, where
only the FFTW CPU indexer exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Regressions from docking the processing panel + live plots:
- Default window size is now screen-aware (fits a laptop) instead of a fixed
1200x1200.
- Give the bottom dock area a guaranteed height (resizeDocks vertical) and a
minimum height on the dataset-info chart, so the plot and its axis labels stay
visible next to the processing panel.
- Activating a metadata snapshot (Show original / View results) no longer re-runs
full analysis: it re-reads the image against the snapshot's stored results with
reanalysis suppressed, instead of re-indexing on every switch.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 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>
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>
One "Processing settings" window with tabs: Spot finding & indexing | Azimuthal | Bragg
integration | Scaling, replacing the two separate settings windows. The spot/index and azimuthal
tabs reuse the existing windows' widgets unchanged (their content is lifted into tabs via
takeCentralWidget), so all their logic/signals keep working; Bragg integration and scaling are new
editable panels (previously not adjustable in the GUI).
JFJochImageReadingWorker gains UpdateBraggIntegrationSettings / UpdateScalingSettings; both persist
as worker state and are re-imported into curr_experiment on file load / dataset update (like the
indexing/azint settings), so they apply to interactive analysis (Bragg) and flow into processing
jobs via GetReprocessingInputs (Bragg + scaling). Scaling only affects the job post-pass, so it is
just stored, not reanalyzed.
Verified: jfjoch_viewer builds and runs (offscreen) with the converged window.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Foundation for making processing a first-class GUI activity:
- process/JFJochProcessCommandLine: reconstruct the equivalent jfjoch_process / jfjoch_azint
command line from a ProcessConfig + DiffractionExperiment + input path, for handing a job
off to a cluster. Unit-tested (full + azint).
- viewer/JFJochProcessController: runs one JFJochProcess job off the GUI thread (its own private
reader; HDF5 access is globally serialized so it is safe next to the interactive reader) and
reports back via queued Qt signals (started/phaseChanged/progress/finished/failed). Cancel()
forwards to JFJochProcess::Cancel(). Progress is throttled to ~200 updates per run.
The visible processing UI (jobs window + snapshot switcher + converged settings) builds on this.
Verified: tests/jfjoch_test [process]; jfjoch_viewer links and builds against JFJochProcess.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cuFFT is the only CUDA component linked dynamically (cudart and the
fast-feedback indexer are static), so the prior Windows installer would
fail to launch the GPU path on a host without a CUDA toolkit. Ship
cufft64_*.dll next to the viewer (CUDA 13 keeps it in bin/x64, earlier
toolkits in bin); the DLL is self-contained, so the installed app needs
only an NVIDIA driver.
Tag the variant where it matters and nowhere else: the installer
filename (-cuda<major> / -cpu) and the Add/Remove Programs entry
("Jungfraujoch (CUDA)" / "(CPU)") advertise it, while the install folder
and Start Menu group stay plain "Jungfraujoch" -- the CUDA build is a
strict superset, so the two variants share a location and replace each
other.
Docs: SOFTWARE.md + JFJOCH_VIEWER.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MSVC/Windows build fixes:
- Force JFJOCH_VIEWER_ONLY ON for Windows and macOS; the broker/receiver/FPGA/
writer server stack is Linux-only, so those platforms build the viewer subset.
- Vendor an OpenBSD/NetBSD getopt/getopt_long shim (tools/wingetopt/, BSD/ISC)
as a WIN32-only static lib -- the MSVC CRT has no <getopt.h> -- and link it
into the four portable CLI tools on Windows.
- jfjoch_extract_hkl.cpp: include <getopt.h> explicitly (it relied on glibc's
transitive <unistd.h>).
- jfjoch_process.cpp: guard <unistd.h> with #ifndef _WIN32.
- Guard JFJochStreamWriter and jfjoch_writer with IF(NOT JFJOCH_VIEWER_ONLY):
the former pulls in JFJochImagePuller, the latter uses a fork()/waitpid()
multi-process design; neither belongs to the portable viewer subset.
- Record wingetopt in THIRD_PARTY_NOTICES.md and licenses/.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Acknowledge all bundled third-party software and satisfy attribution/notice
requirements, while keeping it maintainable:
- THIRD_PARTY_NOTICES.md: human-readable manifest (component, copyright, SPDX
license, link) for fetched, vendored, and runtime/SDK dependencies.
- licenses/: verbatim license texts; COLLECT.sh regenerates them from the
build trees and system SDK locations.
- Bundle the verbatim Qt LGPL-3.0 text and the CUDA Toolkit 12.8 EULA.
- frontend: self-contained npm attribution generator (`npm run licenses` ->
dist/THIRD_PARTY_LICENSES.txt), wired into the frontend build target.
- Install LICENSE + notices + licenses/ into share/doc/jfjoch for every
packaged component.
- viewer: Help > "Third-party Licenses" window (QTextBrowser) showing a
generated, self-contained HTML built from licenses/.
- docs/SOFTWARE.md: drop the stale hand-kept dependency lists; point at the
manifest.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The viewer's only .qrc is compiled explicitly via QT_ADD_RESOURCES into
APP_RESOURCES; no .qrc is added directly as a target source, so AUTORCC never
acted on anything. Remove the dead flag.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
NSIS installer was missing several things on Windows:
- License: show the repo GPLv3 LICENSE as the click-through license page
(CPACK_RESOURCE_FILE_LICENSE).
- Start Menu: no shortcut was created -- add CPACK_PACKAGE_EXECUTABLES for
jfjoch_viewer, and embed an app icon so the shortcut is not generic. The
icon is a new multi-size jfjoch.ico (256 PNG + 48/32/16) compiled into the
.exe via resources/jfjoch.rc; macOS gets the matching jfjoch.icns copied
into the .app bundle (MACOSX_BUNDLE_ICON_FILE). Both derived from
resources/jfjoch.png, padded square with transparent bands.
- Naming: install folder, Start Menu group and Add/Remove Programs entry are
now "Jungfraujoch" instead of "jfjoch <version>".
Also ship the offline analysis CLIs (jfjoch_process/scale/azint/extract_hkl)
in viewer-only / Windows packages: JFJochReceiverPlots now lives in
JFJochCommon, so their stale JFJochReceiver link is dropped, leaving only the
portable libs (reader/image_analysis/writer/common). tools/CMakeLists.txt is
split so those four build everywhere while the hardware tools stay gated
behind NOT JFJOCH_VIEWER_ONLY, and the viewer-only branch now adds tools/.
They install into the "viewer" CPack component.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the platform packaging the viewer was missing so it can ship as a .dmg
(macOS) or installer (Windows):
- viewer: set MACOSX_BUNDLE (a .app bundle on macOS) and WIN32_EXECUTABLE
(GUI subsystem, no console window) -- both ignored where they don't apply;
install with BUNDLE/RUNTIME destinations.
- viewer: qt_generate_deploy_app_script + install(SCRIPT) to bundle the Qt
runtime at install time (windeployqt on Windows, macdeployqt on macOS).
Gated on Qt >= 6.5, which is where the OUTPUT_SCRIPT signature and the Linux
deploy path landed; with a static Qt (our Linux builds) it is a no-op.
- CPack: select DragNDrop (.dmg) on macOS and NSIS on Windows, ahead of the
Linux-only /etc/* probes; DEB/RPM path unchanged.
Verified: configures + generates cleanly on Linux with the viewer enabled
(Qt 6.4.2 -> deploy step correctly skipped).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Both are leaf deps (JFJochPreview / JFJochIndexing) that only our own code
looks for, so building them ourselves removes the system-package lottery and
gives a reproducible, statically-linked build on every platform.
- libtiff: FetchContent, library only (jbig/zstd/lzma/jpeg/old-jpeg/tools/
tests off). The C++ binding (TIFF::CXX / libtiffxx) is packaged
inconsistently across distros -- missing on Rocky 9 -- and absent on
Windows, so find_package(TIFF COMPONENTS CXX) was unreliable; that call is
removed and JFJochPreview links the tiff/tiffxx targets directly. GitHub
mirror because upstream (gitlab) is unreachable from some restricted hosts.
- FFTW: FetchContent single precision (ENABLE_FLOAT) from the release tarball
-- the git repo ships no pre-generated codelets (needs OCaml genfft). It's
now always available, so the CPU FFT indexer is always built and
JFJOCH_USE_FFTW always defined; the "FFTW disabled" path is gone. Static
(libfftw3f.a) via the global BUILD_SHARED_LIBS OFF.
Verified on Linux: jfjoch_viewer builds and links libfftw3f.a + libtiff*.a,
all static.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The ROI bound editors now have a white background, a capped width and
right-aligned text, which reads better for numeric entry.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Restore the ROI-to-mask action on the new list: "Add to mask" and
"Subtract from mask" buttons rasterise the selected ROI into the user
mask (set or clear), through the same UpdateUserMask_i path. The ROI is
evaluated with per-pixel resolution and phi from the geometry, so box,
circle and azimuthal (sector) ROIs all map correctly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
With the scratch ROI panel gone, delete the now-orphaned
JFJochViewerImageROIStatistics(_Box/_Circle) widgets and the worker's
unused scratch-ROI plumbing (SetROIBox/SetROICircle, the ROIElement
member, AddROIToUserMask/SubtractROIFromUserMask). ROI-to-mask, if wanted
later, should act on the selected list ROI.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two Mask-menu entries read a 16-bit TIFF (via ReadTIFFFromString16) and
apply it as the user mask: "replace" overwrites the current mask, "add"
unions the TIFF into it. The TIFF must match the detector dimensions; any
non-zero pixel masks. Both go through UpdateUserMask_i like the other
mask edits.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add Download and "Upload to server" buttons to the ROI panel. The HTTP
reader gains GetROIDefinitions (GET /config/roi) and UploadROIDefinitions
(PUT /config/roi), converting between ROIDefinition and the generated
Roi_definitions model (including the optional azimuthal phi sector), the
same shapes OpenAPIConvert uses on the server. Download applies the
fetched ROIs through SetROIDefinition; upload pushes the current ones.
Both are no-ops unless the viewer is connected to a broker.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The interactive shift-drag (box) / shift+ctrl-drag (circle) now creates a
new persistent ROI in the list instead of feeding the old single-ROI
scratch panel. The base emits a roiScratchDrawn hook on release; the
diffraction image turns the drawn shape into a named ROI committed via
SetROIDefinition.
The old JFJochViewerImageROIStatistics scratch panel and all its wiring
(box/circle configuration, single-ROI result, add/subtract user mask) are
removed from the side panel and window; the ROI list is now the single
source.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The ROI panel now shows editable numeric fields for the selected ROI,
labelled by type: box min/max X/Y, circle centre/radius, or azimuthal
Q-range and phi sector. Editing a field rebuilds that ROI and commits it
through the same SetROIDefinition path, so all three types can be created
(via +) and dialled in by typing, not only by dragging.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Azimuthal ROIs now show discrete grab handles on the selected ROI: the
inner/outer arc (resize Q/d) and, for a sector, the two phi edges
(rotate). Editing is by clicking a handle, with a generous tolerance,
which fixes the previously near-impossible phi-edge grab. Clicking the
(large) interior of an azimuthal ROI now only selects it and lets the
view pan, instead of capturing the gesture.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extend canvas ROI editing beyond move:
- Box: drag corners/edges to resize (handles shown on the selected ROI).
- Circle: drag the perimeter to resize, interior to move.
- Azimuthal: drag the inner/outer arc to change the Q/d range, or a radial
edge to rotate a phi bound; sampled through the geometry so it tracks
the conic.
- Delete removes the selected ROI (the view now takes keyboard focus).
All edits go through the same live, throttled SetROIDefinition path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Clicking a box/circle on the image now selects it (syncing the side-panel
combobox) and grabs it for moving, with a closed-hand cursor during the
drag. The move recomputes ROI statistics live rather than only on release,
throttled to at most one in-flight recompute so the worker is not flooded.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add base-class mouse hooks (roiEditPress/Move/Release) so the diffraction
image can edit the persistent ROI selected in the side-panel combobox.
The selected ROI is highlighted (dashed, thicker), and dragging its
interior moves a box or circle; on release the new geometry is committed
through SetROIDefinition, which recomputes only the ROIs. Resize,
azimuthal handles and delete-key follow.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Edited ROIs now override the file's for every subsequently loaded image
and survive settings changes, until a new file is opened (previously a
delete/add was lost on the next image). Tracked via an roi_override_ that
is re-applied to curr_experiment and to each loaded image's dataset.
- The ROI selector is a compact combobox instead of a list widget.
- "Show labels" and "Translucent fill" share one row to save space.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add JFJochViewerROIList to the side panel: a list of the dataset's ROIs
with selection, add (box/circle/azimuthal), rename and delete, plus a
statistics readout (sum/mean/std/max/valid/masked/centre-of-mass) for the
selected ROI, taken from the analysis output for the current image. Edits
emit a full ROIDefinition, routed to the worker's SetROIDefinition.
Per-ROI statistics now live in this panel rather than the canvas labels;
the diffraction image's labels show only the ROI name, and the ad-hoc
ROIIntegrationCPU computation there is removed in favour of the analysis
pipeline. The result widget now reports std dev instead of variance.
The single-ROI scratch panel remains for now and will be retired once the
interactive canvas editing replaces it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The reading worker's experiment is the source of truth for ROIs. Add a
SetROIDefinition slot that updates curr_experiment.ROI(), rebuilds the
analysis ROI engine, mutates the dataset (so the canvas reflects the new
ROIs) and recomputes only the ROIs for the current image via RunROIOnly.
On image load when full re-analysis is off, ROIs are still computed via
AnalyzeROIOnly so the statistics stay current.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When ROI labels are shown, each ROI's label now also reports its sum,
max and pixel count for the current image. Rather than reimplementing the
accumulation, this reuses the existing ROIIntegrationCPU engine (the
software counterpart of the FPGA roi_calc), built from the experiment and
cached per dataset. A small adapter folds the viewer's gap sentinel
(INT32_MIN+1) onto the engine's masked sentinel (INT32_MIN) so masked and
saturated pixels are handled correctly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The full-ring annulus built the inner ring as a separate QPainterPath and
merged it with addPath, which stitched a spurious segment from (0,0) to
the ring. Build both concentric rings as subpaths of one path, each begun
with an explicit moveTo, so there is no connecting segment.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Azimuthal ROIs now render on the diffraction image as annular sectors
(or full-ring annuli), sampled through DiffractionGeometry::ResPhiToPxl
so the outline follows the ROI footprint, including wrap-around sectors.
Add two side-panel toggles (both default off): a translucent fill for
every ROI (helpful when outline colours clash with the image colour map,
and with many ROIs) and ROI name labels (constant on-screen size). Wired
side panel -> window -> diffraction image like the existing feature
toggles.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When a file with ROI definitions is opened (read into experiment.ROI()
by the HDF5 reader), the diffraction image now overlays the configured
box and circle ROIs as distinct colour-coded outlines, alongside the
existing resolution rings and spots. This is the first step of the
ROI-map-based multi-ROI canvas: showing the ROIs loaded from a file.
Azimuthal ROIs (wedge rendering) and per-ROI statistics from the bitmap
follow in subsequent steps.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>