Skip to content

Conversation

@timtreis
Copy link
Member

@timtreis timtreis commented Oct 29, 2025

import squidpy as sq

sdata = sq.datasets.visium_hne_sdata()
sq.experimental.im.make_tiles(sdata, image_key="hne", preview=True)
image
import squidpy as sq

sdata = sq.datasets.visium_hne_sdata()
sq.experimental.im.make_tiles_from_spots(
    sdata,
    spots_key="spots",
    image_key="hne",
    tissue_mask_key="hne_tissue",
	preview=True,
)
image

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 67.64045% with 144 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.88%. Comparing base (cacd943) to head (623ab3e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/squidpy/experimental/im/_make_tiles.py 69.26% 72 Missing and 50 partials ⚠️
src/squidpy/experimental/im/_utils.py 50.00% 8 Missing and 3 partials ⚠️
src/squidpy/experimental/im/_detect_tissue.py 58.82% 6 Missing and 1 partial ⚠️
src/squidpy/_utils.py 55.55% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1053      +/-   ##
==========================================
+ Coverage   65.52%   65.88%   +0.35%     
==========================================
  Files          43       44       +1     
  Lines        6364     6762     +398     
  Branches     1064     1137      +73     
==========================================
+ Hits         4170     4455     +285     
- Misses       1810     1874      +64     
- Partials      384      433      +49     
Files with missing lines Coverage Δ
src/squidpy/_utils.py 56.25% <55.55%> (+0.89%) ⬆️
src/squidpy/experimental/im/_detect_tissue.py 52.94% <58.82%> (+2.31%) ⬆️
src/squidpy/experimental/im/_utils.py 38.29% <50.00%> (+3.00%) ⬆️
src/squidpy/experimental/im/_make_tiles.py 69.26% <69.26%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timtreis timtreis changed the title Add helper function to tile image for inference Add helper functions to tile image for inference Nov 24, 2025
Copy link
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

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

A few random comments as requested

@timtreis timtreis requested a review from LLehner November 25, 2025 09:33
preview: bool = True,
) -> None:
"""
Create tiles centered on Visium spots, classify them by tissue coverage, and optionally render a preview.
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to restrict this to Visium spots? This could also work for arbitrary segmentations as long as cell coordinates + e.g radius are given. It definitely works on custom cell circles.

Copy link
Member

Choose a reason for hiding this comment

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

I think you need to import spatialdata-plot to fix that

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it necessary to restrict this to Visium spots? This could also work for arbitrary segmentations

I think yes, because it generates non-overlapping tiles. Yes, you can generate them centered around cell segmentation masks but then the tiles would overlap which would probably create interpretability issues. So I'd semantically restrict it to the clean usecase - what users then actually do with it is their issue imho.

I think you need to import spatialdata-plot to fix that

wdym @selmanozleyen ?

Copy link
Member

@LLehner LLehner left a comment

Choose a reason for hiding this comment

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

Looks good! Just wondering about the plot warning, but maybe thats on my side.

Copy link
Member

@selmanozleyen selmanozleyen left a comment

Choose a reason for hiding this comment

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

Besides my comments I checked the code coverage and it suggested that some cases weren't tested.

  •  if H_mask != H or W_mask != W: # (line 803)
    

I am not sure if its accurate but overall I'd check the coverage report to ensure robustness for some cases.

Copy link
Member

@selmanozleyen selmanozleyen left a comment

Choose a reason for hiding this comment

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

looks good

@timtreis timtreis merged commit e837ce6 into main Dec 1, 2025
17 of 19 checks passed
@timtreis timtreis deleted the feature/hne_tiling_from_qc_base branch December 1, 2025 12:52
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.

5 participants