save_to_cache¶
- save_to_cache(probabilities, coordinates, probabilities_zarr, coordinates_zarr, save_path='temp.zarr')[source]¶
Save computed feature and coordinate arrays to Zarr cache.
This function computes the given Dask arrays (probabilities and coordinates), resizes the corresponding Zarr datasets to accommodate the new data, and appends the results. If the Zarr datasets do not exist, it initializes them within the specified Zarr group.
- Parameters:
probabilities (list[dask.array.Array]) – List of Dask arrays representing extracted feature maps.
coordinates (list[dask.array.Array]) – List of Dask arrays representing patch coordinates.
probabilities_zarr (zarr.Array | None) – Existing Zarr dataset for feature maps. If None, a new one is created.
coordinates_zarr (zarr.Array | None) – Existing Zarr dataset for coordinates. If None, a new one is created.
save_path (str | Path) – Path to the Zarr group for saving datasets. Defaults to “temp.zarr”.
- Returns:
Updated Zarr datasets for feature maps and coordinates.
- Return type:
tuple[zarr.Array, zarr.Array]