spatialdata_io.steinbock#
- spatialdata_io.steinbock(path, labels_kind='deepcell', imread_kwargs=mappingproxy({}), image_models_kwargs=mappingproxy({}))#
Read a Steinbock output into a SpatialData object.
See also
- Parameters:
labels_kind (
Literal['deepcell','ilastik'] (default:'deepcell')) – Kind of labels to use. Eitherdeepcellorilastik.imread_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Keyword arguments to pass to the image reader.image_models_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Keyword arguments to pass to the image models.
- Return type:
- Returns:
Notes
Mandatory outputs of the Steinbock pipeline required by this reader:
cells.h5ad: the AnnData object in the main working directoryome/: directory containing the steinbock OME-TIFF images (*.ome.tiff)masks_deepcell/ormasks_ilastik/: the masks directory, selected via thelabels_kindparameter (only one is used at a time)
When exporting to AnnData with
steinbock export anndata, the--infooption (default:images.csv) controls whether image metadata is embedded. When present, steinbock copies theimagecolumn fromimages.csvintoadata.obs.imagefor every cell; this reader requires that column to map cells to their source image. Without it,adata.obs.imagewill not exist and the reader will fail.images.csvis generated automatically bysteinbock preprocess imc imageswhen starting from.mcdfiles. Users who start from TIFF images must hand-craftimages.csvwith at least the columnsimage,width_px,height_px, andnum_channelsas described in the Steinbock file types documentation.All AnnData tables, masks, and OME-TIFFs must follow the steinbock naming conventions so that the reader can correctly match all instances.