Fix image roi rgb image#1246
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the image ROI/crosshair behavior to correctly handle RGB (vector-valued) images by suppressing scalar intensity/profile generation and ensuring stale ROI profile curves are cleared when switching from scalar to RGB image data.
Changes:
- Prevent ROI profile slice computation for non-2D scalar images and clear any existing live/pinned ROI curves when an unsupported image arrives.
- Omit scalar intensity lines in live/pinned coordinate labels (including detached pin labels) when the underlying image is RGB.
- Add unit tests covering ROI curve clearing on RGB updates and label behavior for RGB images.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit_tests/test_image_view_next_gen.py | Adds coverage ensuring ROI curves are cleared and detached pin labels omit intensity for RGB images. |
| tests/unit_tests/test_crosshair.py | Adds coverage ensuring crosshair live/pinned labels omit scalar intensity for RGB images. |
| bec_widgets/widgets/plots/plot_base.py | Skips intensity extraction for detached pin labels when the image is RGB. |
| bec_widgets/widgets/plots/image/image_base.py | Guards ROI slice computation to scalar 2D images and adds a helper to clear stale ROI curves when unsupported images arrive. |
| bec_widgets/utils/crosshair.py | Skips intensity extraction for crosshair coordinate labels when the image is RGB. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Benchmark comparisonThreshold: 20% (lower is better). No benchmark regression exceeded the configured threshold. No benchmark improvement exceeded the configured threshold. All benchmark results
|
No description provided.