scverse / squidpy

Spatial Single Cell Analysis in Python
https://squidpy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
400 stars 70 forks source link

compute graph base on spatialdata regions and add mask graph based on polygon #842

Open giovp opened 3 weeks ago

giovp commented 3 weeks ago

IMPORTANT: Please search among the Pull requests before creating one.

Description

This PR introduces two features:

masking

The idea is, given a graph and a polygon, mask it base on the polygon (either every edge contained inside the polygon, or everything that is outside or partially outside to the polygon). e.g. see Original image

Positive mask

image

Negative mask image

How has this been tested?

It would be nice to have feedback on argument names/apis and I should also be adding an example to show how to use it.

giovp commented 3 weeks ago

requires release of spatialdata