lazyslide.pl.tiles

Contents

lazyslide.pl.tiles#

tiles(wsi, feature_key=None, color=None, tissue_id=None, tissue_key=None, tile_key='tiles', title=None, style='heatmap', show_image=True, show_contours=True, show_id=False, mark_origin=True, scalebar=True, in_bounds=True, img_bytes_limit=2000000000.0, zoom=None, alpha=0.9, smooth=False, smooth_scale=2, marker='o', vmin=None, vmax=None, cmap=None, norm=None, palette=None, size=None, gridcolor='k', linewidth=0.1, ax=None, rasterized=True, ncols=4, wspace=0.5, hspace=0.5, **kwargs)#

Display the tiles.

Parameters:
wsiWSIData

The whole-slide image object.

feature_keystr, default: None

The feature key assigned when generating the numeric tile features.

colorstr, default: None

The column/ feature name that should be visualized from feature_key. If feature_key is None, this is the column name from the tiles table.

tissue_idint or ‘all’, default: None

The tissue id (piece) to plot. If None, all will be plotted.

tissue_keystr, default: “tissue”

The tissue key.

tile_keystr, default: “tiles”

The key of the tiles in the shapes slot.

titlestr, default: None

The title of the plot.

style{“heatmap”, “scatter”}, default: “heatmap”

The style of the plot.

show_imagebool, default: True

Show the tissue image.

show_contoursbool, default: True

Show the tissue contours.

mark_originbool, default: True

Show the origin.

scalebarbool, default: True

Show the scalebar.

zoom(xmin, xmax, ymin, ymax), default: None

A zoom view for the current viewport. If in range [0, 1], will be interpreted as a fraction of the image size. If > 1, will be interpreted as the absolute size in pixels.

show_idbool, default: False

Show the tissue (piece) id.

alphafloat, default: 0.9

The transparency of the points.

markerstr, default: “o”

The marker of the points.

vminfloat, default: None

The minimum value of the color map.

vmaxfloat, default: None

The maximum value of the color map.

cmapstr, default: None

The color map.

normmatplotlib.colors.Normalize, default: None

The normalization of the color map.

palettestr, default: None

The color palette.

sizeint, default: 50

The size of the points.

axmatplotlib.axes.Axes, default: None

The axes to plot on.

rasterizedbool, default: False

Rasterize the points.

kwargsdict

Additional keyword arguments for plotting.

Examples

>>> import lazyslide as zs
>>> wsi = zs.datasets.sample()
>>> zs.tl.tile_prediction(wsi, "contrast")
>>> zs.pl.tiles(wsi, tissue_id=0, color='contrast')
../../_images/lazyslide-pl-tiles-1.png