@@ -953,10 +953,41 @@ def add_pyramid(
953953 ``multiscales`` metadata. Existing calibration is preserved; pass
954954 *pixel_size* to set it.
955955
956+ Parameters
957+ ----------
958+ group_path : str or Path
959+ Zarr group containing the full-resolution array at *base*.
960+ base : str, optional
961+ Component name of the existing full-resolution level (default
962+ ``"0"``). Auto-detected from existing ``multiscales`` metadata if
963+ present, overriding this.
964+ axes : str, optional
965+ One letter per axis, e.g. ``"zyx"``. ``None`` β inferred from
966+ existing metadata, or from the array's dimensionality.
967+ pixel_size : dict, tuple or None, optional
968+ Physical voxel size in micrometers. ``None`` β read from the store's
969+ existing calibration, if any.
970+ n_levels : int, optional
971+ Maximum number of levels including the existing full-resolution one
972+ (default 5).
973+ downscale : int, optional
974+ Per-level X/Y downsampling factor (default 2).
975+ chunks : tuple of int, optional
976+ Chunk shape for the written levels. ``None`` β a bounded default.
977+ shard : bool or tuple of int, optional
978+ Sharding request (see :func:`to_ome_zarr`'s *shard*).
979+ progress : bool, optional
980+ Show a per-level dask progress bar (default ``True``).
981+
956982 Returns
957983 -------
958984 str
959985 The path to the updated group.
986+
987+ Examples
988+ --------
989+ >>> add_pyramid("scan.zarr", n_levels=4) # doctest: +SKIP
990+ 'scan.zarr'
960991 """
961992 if downscale < 2 :
962993 raise ValueError ("downscale must be >= 2" )
@@ -1023,10 +1054,38 @@ def register_labels(
10231054 ``labels/.zattrs``, and inherits the parent image's pixel calibration
10241055 (unless *pixel_size* is given).
10251056
1057+ Parameters
1058+ ----------
1059+ image_store : str or Path
1060+ OME-ZARR store path containing the image this label belongs to.
1061+ name : str, optional
1062+ Label image name under ``labels/`` (default ``"labels"``).
1063+ axes : str, optional
1064+ One letter per axis. ``None`` β inferred from the label array.
1065+ pixel_size : dict, tuple or None, optional
1066+ Physical voxel size in micrometers. ``None`` β inherited from the
1067+ parent image's own calibration.
1068+ n_levels : int, optional
1069+ Maximum number of pyramid levels including full resolution
1070+ (default 5).
1071+ downscale : int, optional
1072+ Per-level X/Y downsampling factor (default 2).
1073+ chunks : tuple of int, optional
1074+ Chunk shape for the written levels. ``None`` β a bounded default.
1075+ shard : bool or tuple of int, optional
1076+ Sharding request (see :func:`to_ome_zarr`'s *shard*).
1077+ progress : bool, optional
1078+ Show a per-level dask progress bar (default ``True``).
1079+
10261080 Returns
10271081 -------
10281082 str
10291083 Path to the label group (``image_store/labels/<name>``).
1084+
1085+ Examples
1086+ --------
1087+ >>> register_labels("scan.zarr", "cells") # doctest: +SKIP
1088+ 'scan.zarr/labels/cells'
10301089 """
10311090 store = str (image_store )
10321091 group = f"{ store } /labels/{ name } "
@@ -1078,10 +1137,49 @@ def write_labels(
10781137 single OME-ZARR store. Calibration is inherited from the parent image
10791138 unless *pixel_size* is given.
10801139
1140+ Parameters
1141+ ----------
1142+ image_store : str or Path
1143+ OME-ZARR store this label image belongs to.
1144+ labels : da.Array or np.ndarray
1145+ Integer label array (0 = background), same spatial shape as the
1146+ image.
1147+ name : str, optional
1148+ Label image name under ``labels/`` (default ``"labels"``).
1149+ axes : str, optional
1150+ One letter per axis. ``None`` β inferred from *labels*'
1151+ dimensionality.
1152+ pixel_size : dict, tuple or None, optional
1153+ Physical voxel size in micrometers. ``None`` β inherited from the
1154+ parent image's own calibration.
1155+ n_levels : int, optional
1156+ Maximum number of pyramid levels including full resolution
1157+ (default 5).
1158+ downscale : int, optional
1159+ Per-level X/Y downsampling factor (default 2).
1160+ chunks : tuple of int, optional
1161+ Chunk shape for the written levels. ``None`` β a bounded default.
1162+ shard : bool or tuple of int, optional
1163+ Sharding request (see :func:`to_ome_zarr`'s *shard*).
1164+ progress : bool, optional
1165+ Show a per-level dask progress bar (default ``True``).
1166+ overwrite : bool, optional
1167+ Replace an existing label image of the same *name* (default
1168+ ``False``).
1169+
10811170 Returns
10821171 -------
10831172 str
10841173 Path to the written label group (``image_store/labels/<name>``).
1174+
1175+ Examples
1176+ --------
1177+ >>> from patchworks import merge_tile_labels
1178+ >>> merged = merge_tile_labels(
1179+ ... "stage.zarr", input_component="staged", write_to="merged.zarr"
1180+ ... ) # doctest: +SKIP
1181+ >>> write_labels("scan.zarr", merged, name="cells") # doctest: +SKIP
1182+ 'scan.zarr/labels/cells'
10851183 """
10861184 arr = labels if isinstance (labels , da .Array ) else da .asarray (labels )
10871185 if axes is None :
0 commit comments