Skip to content

Add live multi-diffraction comparison to Show4DSTEM - #244

Merged
bobleesj merged 1 commit into
electronmicroscopy:mainfrom
bobleesj:sep-10-show4dstem-comparison
Sep 10, 2026
Merged

bobleesj merged 1 commit into
electronmicroscopy:mainfrom
bobleesj:sep-10-show4dstem-comparison

Conversation

@bobleesj

@bobleesj bobleesj commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

What problem does it solve?

Screenshot 2026-09-10 at 3 12 19 PM

Comparing 4D-STEM reconstructions requires seeing each dataset's diffraction pattern alongside its virtual image at the same scan position or region. Add compare_dp_mode="all" to the existing Show4DSTEM Multiple view, with shared scan-region Mean/Sum/Max reductions and linked detector interaction.

The comparison grid reuses zoom, pan, reset, scale bars and column controls. Region updates use a latest-pending scheduler with acknowledgements, and dragging a diffraction tile updates the common virtual detector while held. Playback is restricted to Single view; switching to Multiple stops playback. Existing selected/average modes remain available.

What should reviewer(s) do?

  • Follow storyboard S4D-21 and the new API example: compare several datasets, move a shared scan ROI, and drag a detector from a comparison diffraction tile.
  • Verify shared-region reductions, signed values, live updates, zoom/scale bars, and Single/Multiple playback transitions.
  • Review the Python buffer publication and frontend request/acknowledgement lifecycle. This is live-kernel comparison; standalone multi-DP HTML and packed-resident compatibility are not qualified by this PR.

Verification

  • Production frontend build and TypeScript check passed.
  • 22 focused frontend tests passed across region scheduling, detector interaction and progressive comparison.
  • 20 focused Python tests passed across all-diffraction behavior and the HTML export protocol.
  • Real JupyterLab/CUDA workflow exercised a 64x64 scan with native 192x192 diffraction patterns and five displayed datasets. All five virtual images changed during a held diffraction drag; no browser exceptions were captured.
  • Ten headed playback/view checks passed, including stopping playback on entering Multiple and remaining paused when returning to Single. The actual comparison display was visually inspected.
  • The full Python suite did not pass in the current environment. A narrower contract run had 31 passes and two failures in source-string assertions targeting an older QuantEM.GPU backend layout. This draft does not claim baseline equivalence or merge readiness; those failures need isolation before promotion.
  • No 120 FPS, physical-phone, or standalone-export qualification is claimed. No experimental data, screenshots, generated notebooks or build bundles are included.

This PR follows the
scikit-package workflow for
reproducible scientific software.

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
  • Delete bobleesj/quantem.widget:sep-10-show4dstem-comparison from its remote if you own it, it is not long-lived, and no other PR uses it.
  • Remove the dedicated worktree and local sep-10-show4dstem-comparison branch after confirming the worktree is clean.
  • Fetch electronmicroscopy/quantem.widget and update local main before starting new work.

@bobleesj
bobleesj marked this pull request as ready for review September 10, 2026 22:22
@bobleesj
bobleesj merged commit 514ec95 into electronmicroscopy:main Sep 10, 2026
3 of 4 checks passed
@bobleesj
bobleesj deleted the sep-10-show4dstem-comparison branch September 10, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant