Skip to content

Support 3D visualization for points and 2.5D shapes#393

Merged
LucaMarconato merged 7 commits into
scverse:mainfrom
asarigun:main
May 15, 2026
Merged

Support 3D visualization for points and 2.5D shapes#393
LucaMarconato merged 7 commits into
scverse:mainfrom
asarigun:main

Conversation

@asarigun
Copy link
Copy Markdown
Contributor

Closes #31.

Builds on #366 to complete 3D support for vector data:

  • 2.5D circles rendered at correct z depth
  • Affine transforms respect z axis on coordinate system switch
  • Save round-trip no longer drops z from points/shapes
  • UI toggles for 3D points and 2.5D shapes projection
  • Z-range slider to filter by depth

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 75.58140% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.88%. Comparing base (69105e0) to head (a2c765d).
⚠️ Report is 68 commits behind head on main.

Files with missing lines Patch % Lines
src/napari_spatialdata/utils/_utils.py 5.55% 17 Missing ⚠️
src/napari_spatialdata/_viewer.py 92.30% 3 Missing ⚠️
src/napari_spatialdata/_sdata_widgets.py 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #393      +/-   ##
==========================================
+ Coverage   63.08%   70.88%   +7.79%     
==========================================
  Files          19       19              
  Lines        2636     3400     +764     
==========================================
+ Hits         1663     2410     +747     
- Misses        973      990      +17     

☔ View full report in Codecov by Sentry.
📢 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.

@asarigun asarigun mentioned this pull request Apr 16, 2026
Comment thread src/napari_spatialdata/utils/_utils.py Outdated
Comment thread src/napari_spatialdata/utils/_utils.py Outdated
Comment thread src/napari_spatialdata/utils/_utils.py Outdated
Comment thread src/napari_spatialdata/_sdata_widgets.py Outdated
Comment thread src/napari_spatialdata/_sdata_widgets.py Outdated
Comment thread src/napari_spatialdata/_sdata_widgets.py Outdated
Comment thread src/napari_spatialdata/_viewer.py
Comment thread src/napari_spatialdata/_viewer.py
Comment thread src/napari_spatialdata/_viewer.py Outdated
Comment thread src/napari_spatialdata/_viewer.py Outdated
Comment thread tests/test_3d_visualization.py Outdated
Comment thread tests/test_3d_visualization.py
Comment thread tests/test_3d_visualization.py
Comment thread tests/test_3d_visualization.py
Comment thread tests/test_3d_visualization.py
@asarigun
Copy link
Copy Markdown
Contributor Author

Thanks again for the thorough review @LucaMarconato — all 15 threads addressed in a2c765d.

Highlights of this update:

  • Checkboxes renamed to "Discard z for ..." with inverted semantics and a "new layers only" note in the tooltips.
  • Visibility of the 3D Settings is now gated on SdataWidget._sdatas_have_z_axis(...), so 2D-only users don't see them at all.
  • The z-range slider, get_z_range, filter_layers_by_z_range, the TestZBinning class, and the superqt import were all removed; happy to revisit as a follow-up (separate plugin / upstream napari).
  • Test classes collapsed via pytest.parametrize per your suggestion.
  • _get_transform now has a docstring explicitly stating that z is included only when include_z is truthy and the element / transformation has a z axis.

Ready for another look when you have time.

@LucaMarconato
Copy link
Copy Markdown
Member

Thanks for the implementing the suggested changes, ready to merge! 😊

@LucaMarconato LucaMarconato merged commit 3dfb2c0 into scverse:main May 15, 2026
7 checks passed
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.

3D visualization

2 participants