10000 Fix selection of nD-sliced shapes by Czaki · Pull Request #7459 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix selection of nD-sliced shapes #7459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 22, 2024
Merged

Fix selection of nD-sliced shapes #7459

merged 4 commits into from
Dec 22, 2024

Conversation

Czaki
Copy link
Collaborator
@Czaki Czaki commented Dec 20, 2024

References and relevant issues

closes #7458

Description

This PR closes bug with selecting shapes only from current slice, introduced in #7144.

The source of the bug is not filtering out-of-slice shapes when searching for intersecting triangles.

@github-actions github-actions bot added the tests Something related to our tests label Dec 20, 2024
@Czaki Czaki added this to the 0.5.6 milestone Dec 20, 2024
@Czaki Czaki added the bugfix PR with bugfix label Dec 20, 2024
Copy link
Member
@psobolewskiPhD psobolewskiPhD left a comment

Choose a reason for hiding this comment

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

Makes sense and I tested locally that it resolves the serious issue.

Comment on lines +1158 to +1167
next(
inside_indices[p]
for p in pos[::-1]
if np.any(
inside_triangles(
self._visible_shapes[inside_indices[p]][
1
]._all_triangles()
- coord
)
Copy link
Member

Choose a reason for hiding this comment

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

Have I mentioned I hate black? Not sure I have... 🤔

😂 😭

Copy link
Member

Choose a reason for hiding this comment

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

it's ok, we use ruff. 😜

@jni jni added the ready to merge Last chance for comments! Will be merged in ~24h label Dec 20, 2024
Copy link
codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.90%. Comparing base (c1a9153) to head (9c5f930).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
napari/layers/shapes/_shape_list.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7459      +/-   ##
==========================================
- Coverage   92.98%   92.90%   -0.08%     
==========================================
  Files         626      626              
  Lines       58128    58145      +17     
==========================================
- Hits        54048    54022      -26     
- Misses       4080     4123      +43     

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

@jni jni changed the title fix selection of shapes Fix selection of nD-sliced shapes Dec 22, 2024
@jni jni merged commit 681132f into napari:main Dec 22, 2024
42 checks passed
@jni jni deleted the shapes_selection branch December 22, 2024 08:17
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Dec 22, 2024
925F Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nD-Shapes are selectable from any slice, despite not being visible
3 participants
0