The LazySlide workflow#
LazySlide operations are grouped by intent:
Namespace |
Purpose |
Examples |
|---|---|---|
|
Prepare spatial regions |
find tissue, create tiles, build a graph |
|
Run learned segmentation |
tissue, cells, semantic classes, artifacts |
|
Analyze tiles and features |
embeddings, predictions, spatial domains |
|
Inspect and visualize results |
tissue, tiles, annotations, interactive viewer |
|
Exchange annotations |
load and export spatial annotations |
Dependencies between stages#
Most pipelines follow this order:
Open a WSI and validate its metadata.
Find or import regions of interest.
Create one or more tile sets.
Optionally score or filter tile quality.
Run segmentation, feature extraction, or prediction.
Build spatial or slide-level summaries.
Visualize and save the result.
Later stages refer to earlier results by key. For example, feature extraction reads a tile_key, then creates a feature table associated with those exact tiles. If tiles are replaced afterward, the old feature rows may no longer correspond to the tile table.
Functions add data in place#
Many LazySlide functions mutate wsi and return None. This is intentional:
zs.pp.find_tissues(wsi) # adds wsi.shapes["tissues"]
zs.pp.tile_tissues(wsi, 256, mpp=0.5) # adds wsi.shapes["tiles"]
zs.tl.feature_extraction(wsi, "uni") # adds a feature table
Use key_added to preserve alternative results:
zs.pp.find_tissues(wsi, method="entropy", key_added="tissues_entropy")
zs.pp.tile_tissues(
wsi,
256,
mpp=1.0,
tissue_key="tissues_entropy",
key_added="tiles_1mpp",
)
See the output-key reference for the default locations.