@@ -61,6 +61,58 @@ its enum values through strings or lookup tables.
6161 )
6262 )
6363
64+ Zarr batch layout
65+ -----------------
66+
67+ ``ZarrStorageBackend.save_batch `` requires a ``ZarrBatchLayout `` from
68+ ``polystore.zarr_batch ``. The layout declares every non-pixel axis, its opaque
69+ semantic values, and the exact coordinate of each two-dimensional image plane.
70+ PolyStore validates that the coordinates form one complete dense product, so
71+ item order is never inferred from filenames or list position.
72+
73+ ``ZarrBatchAxisRole.ARRAY `` places an axis inside each OME-NGFF image array.
74+ ``ZarrBatchAxisRole.HCS_IMAGE `` projects one axis into the well's HCS image
75+ groups. A layout may declare at most one HCS image axis. This keeps each image
76+ array within the OME-NGFF ``t, c, z, y, x `` model while preserving fields or
77+ sites as distinct HCS images.
78+
79+ .. code-block :: python
80+
81+ from polystore.zarr_batch import (
82+ ZarrBatchAxis,
83+ ZarrBatchAxisRole,
84+ ZarrBatchLayout,
85+ )
86+
87+ layout = ZarrBatchLayout(
88+ axes = (
89+ ZarrBatchAxis(" t" , " time" , (" 1" , " 2" )),
90+ ZarrBatchAxis(
91+ " field" ,
92+ " field" ,
93+ (" 3" , " 7" ),
94+ ZarrBatchAxisRole.HCS_IMAGE ,
95+ ),
96+ ZarrBatchAxis(" c" , " channel" , (" DNA" , " RNA" )),
97+ ZarrBatchAxis(" z" , " space" , (" 1" ,)),
98+ ),
99+ item_coordinates = (
100+ (0 , 0 , 0 , 0 ),
101+ (0 , 0 , 1 , 0 ),
102+ (0 , 1 , 0 , 0 ),
103+ (0 , 1 , 1 , 0 ),
104+ (1 , 0 , 0 , 0 ),
105+ (1 , 0 , 1 , 0 ),
106+ (1 , 1 , 0 , 0 ),
107+ (1 , 1 , 1 , 0 ),
108+ ),
109+ )
110+
111+ The backend persists both filename-to-coordinate mappings and semantic axis
112+ values. ``load_batch `` uses the stored coordinates directly, and readers can
113+ use ``ZarrStoredBatchSemantics `` to recover application-owned labels without
114+ teaching PolyStore what those labels mean.
115+
64116Bounded native sampling
65117-----------------------
66118
0 commit comments