scallops.io.create_multiscene_hyperstack

scallops.io.create_multiscene_hyperstack(uri, images, output_order='ctzyx', **kwargs)

Create a multi-scene hyperstack image from a dictionary of xarray DataArrays.

This function creates a multi-scene hyperstack image from a dictionary of xarray DataArrays, where each DataArray represents an image scene. The images are arranged according to the specified output order.

Parameters:
  • uri (str) – URI to save the multi-scene hyperstack image.

  • images (Dict[str, DataArray]) – Dictionary containing image scenes, where keys are scene names and values are xarray DataArrays.

  • output_order (str) – Order of dimensions in the output hyperstack. Defaults to ‘ctzyx’. Supported dimensions are ‘s’, ‘c’, ‘t’, ‘z’, ‘y’, and ‘x’.

  • kwargs – Additional arguments to pass to OmeTiffWriter.save().

Example:

import scallops.io
import xarray as xr
import numpy as np

# Create example image scenes
scene1 = xr.DataArray(
    np.random.rand(1, 3, 10, 512, 512), dims=("c", "t", "z", "y", "x")
)
scene2 = xr.DataArray(
    np.random.rand(1, 3, 10, 512, 512), dims=("c", "t", "z", "y", "x")
)

# Create a dictionary of image scenes
images = {"Scene1": scene1, "Scene2": scene2}

# Define output URI
output_uri = "path/to/output/multiscene_hyperstack.tiff"

# Create the multi-scene hyperstack image
scallops.io.create_multiscene_hyperstack(output_uri, images)