scallops.io.save_ome_tiff

scallops.io.save_ome_tiff(data, uri, dim_order=None, compute=True, attrs=None, ome_xml=None)

Save array to OME-TIFF format.

This function saves the input data to an OME-TIFF file. If the specified URI is not local, the data is first written to a temporary file and then moved to the specified URI.

Parameters:
  • data (ndarray | DataArray | Array) – The data to save.

  • uri (str) – URI to save the OME-TIFF file to.

  • dim_order (str | list[str | None] | None) – Order of the dimensions.

  • compute (bool) – If true compute immediately otherwise a list of dask.delayed.Delayed is returned.

  • attrs (Mapping[str, Any] | None) – Key-values to save as map attributes

  • ome_xml (str | OME)

Returns:

Empty list if the compute flag is True, otherwise it returns a list of dask.delayed.Delayed representing the value to be computed by dask.

Return type:

list[Delayed]

Example:

import scallops.io
import numpy as np

# Create some example data
data = np.random.rand(10, 512, 512)

# Save the data to an OME-TIFF file
uri = "path/to/save/file.ome.tiff"
scallops.io.save_ome_tiff(data, uri)