Skip to content

Fix image roi rgb image#1246

Merged
wyzula-jan merged 5 commits into
mainfrom
fix-image-roi-rgb-image
Jul 16, 2026
Merged

Fix image roi rgb image#1246
wyzula-jan merged 5 commits into
mainfrom
fix-image-roi-rgb-image

Conversation

@cappel89

Copy link
Copy Markdown
Member

No description provided.

@cappel89 cappel89 self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/unit_tests/test_image_view_next_gen.py
wyzula-jan
wyzula-jan previously approved these changes Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bec_widgets/widgets/plots/plot_base.py 0.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark comparison

Threshold: 20% (lower is better).
Result: 0 regression(s), 0 improvement(s) beyond threshold.

No benchmark regression exceeded the configured threshold.

No benchmark improvement exceeded the configured threshold.

All benchmark results
Benchmark Baseline Current Change Status
BEC IPython client with companion app 2.20399 s 2.19435 s -0.44% ok
BEC IPython client without companion app 2.18623 s 2.15286 s -1.53% ok
Import bec_widgets 0.0131978 s 0.0137589 s +4.25% ok
tests/unit_tests/benchmarks/test_dock_area_benchmark.py::test_add_waveform_to_dock_area 0.158608 s 0.161921 s +2.09% ok

@wyzula-jan
wyzula-jan merged commit 02628d9 into main Jul 16, 2026
74 of 75 checks passed
@wyzula-jan
wyzula-jan deleted the fix-image-roi-rgb-image branch July 16, 2026 11:49
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.

3 participants