Readers and conventions
The microscope managers in zarrsmith.microscope_manager read a dataset and normalize it to one shared API.
The main reader classes currently exposed by zarrsmith.microscope_manager are:
ArrayManager— wrap an in-memory NumPy or Dask array using ZarrSmith metadata conventions.LuxendoManager— Luxendo XML + HDF5 datasets.OperaManager— Opera Phenix / Opera PE OME-TIFF style datasets.ScapeManager— Leica SCAPE OME-TIFF + XLIF datasets.ViventisManager— Viventis LS1 datasets.ZeissManager— Zeiss CZI datasets.EvidentManager— Olympus/Evident cellSens VSI datasets: the.vsifile plus its_<name>_/folder of.etspixel data, read with slideio. Tiled acquisitions are stored stitched and are read as one image; select a scene withscene_indexorscene_name. The lower-resolution levels that cellSens stores for large images (downsampled in Y and X only) are exposed as extra pyramid levels, so the raw file renders quickly in napari 3D; passnative_levels=Falseto read the full resolution only. Single-tile acquisitions usually have no stored levels.ZarrManager— NGFF v0.4/v0.5 OME-Zarr datasets.ZarrV04Manager— compatibility reader for older v0.4-style datasets.
All file-based readers share the same conventions:
The dataset location is the first argument (
path; forScapeManagerthe OME-TIFF file) andchunksis an optional TCZYX tuple. When omitted,chunksdefaults to the manager’sDEFAULT_CHUNKS((1, 1, 8, 4096, 4096)for most readers,(1, 1, 8, 1024, 1024)forScapeManager,(1, 1, 8, 2048, 2048)forEvidentManager, the native chunking forZeissManager).The dataset is read in the constructor, so
.data(one lazy dask array per pyramid level) and.metadataare available immediately.read()returnsNone.Managers can be used as context managers, which closes any open file handle (HDF5 files for
LuxendoManager) on exit:with mm.LuxendoManager("path/to/luxendo_folder") as lux: lux.to_zarr("output.zarr")
The metadata uses one spelling everywhere: channel colors are
RRGGBBhex strings (no#), spatial units are NGFF names such as"micrometer", and time units are e.g."second".Progress messages (opened scenes, subsets, metadata updates, the Zarr tree printed when opening a store) go through the standard
loggingmodule under the"zarrsmith"logger and are silent by default. Show them with:import logging logging.basicConfig(format="%(message)s") logging.getLogger("zarrsmith").setLevel(logging.INFO)
To support a new acquisition system, see Adding a microscope manager; for acquisitions saved as separate tiles, see Mosaics.