fix: prevent dark Show3D panels during playback - #224
Merged
bobleesj merged 2 commits intoAug 13, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does it solve?
Show3D could apply one absolute stack-wide contrast range to mixed scientific panels such as phase, bright field, and dark field. During playback, temporal averaging, histogram interaction, or layout changes, this made valid panels appear black or white. Panel colormaps and live layout state could also become stale while playback continued.
This change makes multi-panel contrast independent by default. Auto contrast uses each panel's configured percentile range, and optional linked contrast synchronizes only relative handle movement while preserving panel-local numerical ranges.
What should reviewer(s) do?
Review the Show3D contrast and resident WebGPU paths in
js/show3d/index.tsx, the per-panel LUT support injs/colormaps.ts, and the stable per-panel percentile ranges generated insrc/quantem/widget/show3d.py.In the browser regression tests, confirm that mixed Phase/BF/DF panels remain textured and unsaturated through play/pause, histogram dragging, moving average, colormap changes, hidden-panel restoration, and column changes.
Verification
npm run typecheck— passed.npm run build— passed.PYTHONPATH=src python -m pytest -q tests/show3d— 91 passed, 7 skipped.QT_RUN_BROWSER_TESTS=1 PYTHONPATH=src python -m pytest -q tests/show3d/test_zoom_contrast_browser.py— 6 passed, 1 hardware-dependent headless skip.PYTHONPATH=src pytest -qwas run; three unrelated existing environment failures remain in CLI version provenance, an MPS backend mock, and a source-contract assertion that was updated and then passed independently.This PR follows the scikit-package workflow for reproducible scientific software.