Skip to content

🐛 Fix padded contours for Visualization#1095

Open
shaneahmed wants to merge 3 commits into
developfrom
bug-fix-remove-padded-values-in-contours
Open

🐛 Fix padded contours for Visualization#1095
shaneahmed wants to merge 3 commits into
developfrom
bug-fix-remove-padded-values-in-contours

Conversation

@shaneahmed

@shaneahmed shaneahmed commented Jul 9, 2026

Copy link
Copy Markdown
Member
  • This commit fixes visualization of contour overlays with padded values.
  • padded values were introduced to make the contours rectangular in an effort to make np arrays compatible with zarr v3
image

fixed

image

- This commit fixes visualization of contour overlays with padded values.
- padded values were introduced to make the contours rectangular in an effort to make np arrays compatible with zarr v3
@shaneahmed shaneahmed self-assigned this Jul 9, 2026
@shaneahmed shaneahmed added the bug Something isn't working label Jul 9, 2026
@shaneahmed shaneahmed added this to the Release v2.1.3 milestone Jul 9, 2026
@shaneahmed shaneahmed requested a review from Jiaqi-Lv July 9, 2026 13:47
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.88%. Comparing base (1c94d65) to head (1299f47).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1095   +/-   ##
========================================
  Coverage    99.88%   99.88%           
========================================
  Files           86       86           
  Lines        11661    11675   +14     
  Branches      1531     1533    +2     
========================================
+ Hits         11648    11662   +14     
  Misses           7        7           
  Partials         6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Fixes visualization of instance contour overlays when contours have been padded (to support rectangular arrays for Zarr v3 compatibility), by stripping the padding before drawing contours.

Changes:

  • Add a utility (remove_padded_values_in_contours) to remove padding rows from contour arrays.
  • Invoke the new utility in overlay_prediction_contours so padded contours render correctly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tiatoolbox/utils/visualization.py Applies padded-contour cleanup before calling cv2.drawContours so overlays render correctly.
tiatoolbox/utils/misc.py Introduces helper to remove padded rows from contour arrays saved in rectangular form for Zarr v3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tiatoolbox/utils/misc.py Outdated
Comment thread tiatoolbox/utils/misc.py Outdated
Comment thread tiatoolbox/utils/visualization.py

@Jiaqi-Lv Jiaqi-Lv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes the fix works, I've tested on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants