phenotypic.sdk_.load_image_from_store#
- phenotypic.sdk_.load_image_from_store(store_path: Path, *, fallback: ImageTypeName = 'Image') _Image | _GridImage[source]#
Read
phenotypic.image_classfrom a store root and dispatch the loader.Dispatches on
image_class(Image/GridImage), which is the loader-dispatch field. It is notMetadata_ImageType, which is user-visible schema metadata and may beGridSectionon a plainImage.Bypasses the public :meth:`Image.load_zarr` guard, deliberately. That guard refuses a store carrying no
image_class, because a user calling the public verb on such a store has almost certainly mistaken a--mode processexport for a run bundle and wantsimreadinstead. This function is the internal dispatcher: its caller supplies fallback and has therefore already made that determination itself (_cli_process_singlepasses the run’s own image type; the tune CLI passes"GridImage"). Routing throughload_zarrwould raise before the resolved class could ever be used, making fallback dead code. So the resolved class is asked to load the store directly.A store with no bundle content still fails, one layer down and by its own error:
_load_from_storesubscripts the series mapping bare atseries["gray"]andseries["detect_mat"](_image_io_handler.py), so a single-series process store raisesKeyError: 'detect_mat'.- Parameters:
store_path (Path) – Path to a
*.ome.zarrdirectory.fallback (ImageTypeName) – Class name used when the block carries no
image_class.
- Returns:
An
ImageorGridImageloaded from the store.- Raises:
KeyError – If the store root carries no
phenotypicblock, or if it carries one but no bundle series.ValueError – If
store_schema_versionis not this build’s.
- Return type:
_Image | _GridImage