Skip to content
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

Visium hd rasterize bins labels #811

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ArneDefauw
Copy link
Contributor

@ArneDefauw ArneDefauw commented Dec 17, 2024

PR related to scverse/spatialdata-io#211 and provides complimentary changes to spatialdata.rasterize_bins.

See unit test https://github.com/ArneDefauw/spatialdata/blob/5c3edee642bad1eaedbddf2097430315b964bb1a/tests/core/operations/test_rasterize_bins.py#L36

And more in particular https://github.com/ArneDefauw/spatialdata/blob/5c3edee642bad1eaedbddf2097430315b964bb1a/tests/core/operations/test_rasterize_bins.py#L80

Note that even if the table is annotated by a labels layer created by spatialdata.rasterize_bins, we want to be able to run the raterize_bins function, but now withreturn_region_as_labels=True, see https://github.com/ArneDefauw/spatialdata/blob/5c3edee642bad1eaedbddf2097430315b964bb1a/tests/core/operations/test_rasterize_bins.py#L111.
There is a use case for this, e.g. you have leiden cluster ID's, and you want a 'snappy' way to also visualize gene expression levels in napari-spatialdata, see example below:

Screenshot 2024-12-17 at 13 30 42

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 90.32258% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.75%. Comparing base (d746485) to head (5b95fc1).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata/_core/operations/rasterize_bins.py 90.32% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #811      +/-   ##
==========================================
- Coverage   91.78%   91.75%   -0.04%     
==========================================
  Files          45       45              
  Lines        7045     7091      +46     
==========================================
+ Hits         6466     6506      +40     
- Misses        579      585       +6     
Files with missing lines Coverage Δ
src/spatialdata/_core/operations/rasterize_bins.py 88.00% <90.32%> (-1.89%) ⬇️

... and 6 files with indirect coverage changes

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.

1 participant