lazyslide.pp.tile_graph#
- tile_graph(wsi, n_neighs=6, n_rings=1, delaunay=False, transform=None, set_diag=False, tile_key='tiles', table_key=None)#
Compute the spatial graph of the tiles.
- Parameters:
- wsi
WSIData The WSIData object to work on.
- n_neighsint, default: 6
The number of neighbors to consider.
- n_ringsint, default: 1
The number of rings to consider.
- delaunaybool, default: False
Whether to use Delaunay triangulation.
- transformstr, default: None
The transformation to apply to the graph.
- set_diagbool, default: False
Whether to set the diagonal to 1.
- tile_keystr, default: ‘tiles’
The tile key.
- table_keystr, default: None
The table key to store the graph.
- wsi
- Returns:
AnnDataThe tiles with spatial connectivities and distances in an anndata format. | Added to
tile_graph | {key_added}in tables slot of the WSIData object.
Examples
>>> import lazyslide as zs >>> wsi = zs.datasets.sample() >>> zs.pp.find_tissues(wsi) >>> zs.pp.tile_graph(wsi) >>> wsi['tile_graph']