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

merscope reader remove invalid polygons #207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ckmah
Copy link

@ckmah ckmah commented Sep 17, 2024

Reading invalid polygons causes the Merscope reader to fail. This should be rare, but I have run into this in one of our my datasets.

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 45.50%. Comparing base (54da345) to head (15f8f68).
Report is 191 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_io/readers/merscope.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #207      +/-   ##
==========================================
+ Coverage   35.91%   45.50%   +9.59%     
==========================================
  Files          19       22       +3     
  Lines        1715     2149     +434     
==========================================
+ Hits          616      978     +362     
- Misses       1099     1171      +72     
Files with missing lines Coverage Δ
src/spatialdata_io/readers/merscope.py 24.44% <33.33%> (-0.56%) ⬇️

... and 9 files with indirect coverage changes

@MathieuBo
Copy link

This commit seems to solve my issue reported here: #208

Is there a reason why only polygons from z_index = 0 are kept? By default the reader select plane z=3.

@ckmah
Copy link
Author

ckmah commented Sep 19, 2024

This commit seems to solve my issue reported here: #208

Is there a reason why only polygons from z_index = 0 are kept? By default the reader select plane z=3.

Maybe something like:

if len(z_layer) == 1:
    geo_df = geo_df[geo_df[MerscopeKeys.Z_INDEX] == z_layer[0]
else:
    geo_df = geo_df[geo_df[MerscopeKeys.Z_INDEX] == 0

I assume the provided Merscope cell segmentation is performed only a single z plane, though I'm not familiar with how that's chosen.

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.

3 participants