Skip to content

Restrict visualization overlays to explicitly colored annotations#37

Merged
clemsgrs merged 2 commits intomainfrom
codex/overlay-colored-only
Feb 14, 2026
Merged

Restrict visualization overlays to explicitly colored annotations#37
clemsgrs merged 2 commits intomainfrom
codex/overlay-colored-only

Conversation

@clemsgrs
Copy link
Owner

Summary

  • change mask overlay semantics so only annotations with non-null color_mapping are blended
  • apply the same strict behavior to both tile overlays and slide overlays
  • thread pixel_mapping and color_mapping through sampling visualization calls and validate mapping shape/keys
  • add regression tests ensuring uncolored labels remain untouched (no black/dark overlay)

Details

  • introduced a shared _build_overlay_alpha helper in hs2p/wsi/__init__.py
  • updated overlay_mask_on_tile and overlay_mask_on_slide to use strict colored-label selection
  • updated visualization call chain (visualize_coordinates / draw_grid_from_coordinates) to pass mapping context
  • updated sampling visualization code to validate and forward mappings

Testing

  • /Users/clems/Code/venv/hs2p/bin/python -m pytest tests/test_overlay_semantics.py -q
  • /Users/clems/Code/venv/hs2p/bin/python -m pytest tests -q

@clemsgrs clemsgrs merged commit 148470e into main Feb 14, 2026
1 check failed
@clemsgrs clemsgrs deleted the codex/overlay-colored-only branch February 14, 2026 12:01
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