🐛 Fix padded contours for Visualization#1095
Open
shaneahmed wants to merge 3 commits into
Open
Conversation
- 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
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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_contoursso 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.
Jiaqi-Lv
approved these changes
Jul 10, 2026
Jiaqi-Lv
left a comment
Collaborator
There was a problem hiding this comment.
Yes the fix works, I've tested on my side.
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.
fixed