dvpio.write.image.write_ome_tiff#
- dvpio.write.image.write_ome_tiff(path, image, metadata=None, tile_shape=(1024, 1024), level=None, *, rgb=None)#
Export image data to ome-tiff
Enables out-of-memory computation by writing the data iteratively to disk.
- Parameters:
path (
Path) – Output path for the ome-tiff file.image (
Image2DModel) – Spatialdata Image2DModel. Only writes top-level for pyramidal images.metadata (
dict[str,Any] |None(default:None)) – Metadata dictionary compatible with theOMEschema.tile_shape (
tuple[int,int] (default:(1024, 1024))) – (height, width) of each tile written to the TIFF image. Tile shape must be a multiple of 16.level (
str|None(default:None)) – Level in mulitscale image to write. IfNone, defaults to highest level. Is ignored for single-scale images.rgb (
bool|None(default:None)) – Whether the image is RGB or grayscale. IfNone, infers the image type from the channel names.
- Return type:
- Returns:
Writes an
OME-TIFFimage topath
Example
# Write an image with default parameters write_ome_tiff(path, sdata["image"]) # Write a multiscale image at a lower resolution level write_ome_tiff(path, sdata["multiscale_image"], level="scale2")