pysrx.io¶
pysrx.io
¶
OME-Zarr in, OME-Zarr out. Raw CZIs are never read here: tanoa converts them first.
Stores are tanoa's NGFF 0.5 (zarr v3) TCZYX multiscale images (attrs["ome"]["multiscales"]; flat pre-0.5
attributes are accepted too).
Raw multi-image acquisitions -- light-field views (ZEISS LF4D) and structured-illumination phases (ZEISS Elyra
Lattice SIM), both the CZI H dimension -- are stored as ordinary TCZYX stores with that axis folded into the
channel axis (NGFF allows a single channel-like axis), channel-major: store channel c * n + h for native channel
c and view / phase h. The fold is described in attributes.tanoa.acquisition:
lightfield:n_views,n_channels_native,view_axis = "c",channel_order = "channel-major"and the MLA calibration (seepysrx.optics.LightfieldCalib.from_acquisition);structured_illumination:n_phases,n_channels_native,phase_axis = "c",channel_order = "channel-major",phases_deg(one [a, b] pair per phase),grating_period_px,diffraction_efficiencies,track_type.
Scenes of one light-field acquisition live side by side as <name>.raw/scene-NN.ome.zarr; load_views accepts
either one store or that directory and returns (S, H, C, Y, X). load_phases returns (C, H, Z, Y, X) and reads only
the requested channels and planes.
Views
dataclass
¶
Raw light-field views, (S, H, C, Y, X), in raw camera counts.
acquisition
property
¶
tanoa's acquisition model (feed to optics.LightfieldCalib.from_acquisition).
Phases
dataclass
¶
Raw SIM phase images, (C, H, Z, Y, X), in raw camera counts.
store_attrs(store)
¶
Root attributes of a store (ome, tanoa, ...).
lightfield_meta(store)
¶
The lightfield block of a tanoa-converted raw LF store (raises if the store has none).
sim_meta(store)
¶
The structured_illumination block of a tanoa-converted raw SIM store (raises if the store has none).
scene_stores(path)
¶
One store, or a directory of per-scene stores (scene-NN.ome.zarr), as a sorted list of stores.
load_views(store, level=0, scenes=None)
¶
Raw LF views of one store or a directory of per-scene stores -> (S, H, C, Y, X) in camera counts.
scenes are scene NUMBERS (scene-NN.ome.zarr), not positions, so a partly converted directory is safe.
load_phases(store, level=0, channels=None, z=None)
¶
Raw SIM phases of a tanoa store -> (C, H, Z, Y, X) in camera counts.
channels: native channel indices (default all); z: int, sequence or slice of store planes (default all).
The zarr array is indexed lazily, one native channel's block of phases at a time, so only the requested chunks are
read (a full raw Lattice SIM stack is 39 x 89 x 1280 x 1280 uint16).
load_volume(store, level=0)
¶
A TCZYX tanoa store -> (C, Z, Y, X) float32 (first time point) and (dz, dy, dx) um.
write_volume(vol, dst, spacing_um_zyx, labels=None, extra_attrs=None, attrs_key='pysrx')
¶
(C, Z, Y, X) -> OME-Zarr via tanoa's writer (optional extra pysrx[io]); extra_attrs go under
attrs[attrs_key].