Class OMEZarrWriter

java.lang.Object
qupath.lib.images.writers.ome.zarr.OMEZarrWriter

public class OMEZarrWriter extends Object
An OME-Zarr file writer as described by version 0.4 of the specifications of the Next-generation file formats (NGFF). The transitional "bioformats2raw.layout" and "omero" metadata are also considered.

Use a OMEZarrWriter.Builder to create an instance of this class.

This class is not thread-safe but uses concurrency internally to write tiles.

See PyramidalOMEZarrWriter for a more memory friendly Zarr writer.

  • Method Details

    • writeImage

      public void writeImage() throws InterruptedException
      Write the entire image.

      The image will be written from an internal pool of thread and this function will wait for every writing to complete, so it might take some time depending on the size of the image. The operation can be interrupted.

      Throws:
      InterruptedException - if the calling thread is interrupted
    • writeTile

      public void writeTile(TileRequest tileRequest) throws Exception
      Write the provided tile. This might take some time depending on the size of the tile and the speed of reading the input image and writing the output image.

      Note that the image server used internally by this writer may not be the one given in Builder(ImageServer). Therefore, the TileRequestManager of the internal image server may be different from the one of the provided image server, so functions like TileRequestManager.getAllTileRequests() may not return the expected tiles. Use the TileRequestManager of getReaderServer() to get accurate tiles.

      Parameters:
      tileRequest - the tile to write
      Throws:
      Exception - if an exception occurs while writing the tile
    • getReaderServer

      public ImageServer<BufferedImage> getReaderServer()
      Get the image server used internally by this writer to read the tiles. It can be different from the one given in Builder(ImageServer).

      This function can be useful to get information like the tiles used by this server (for example when using the writeTile(TileRequest) function).

      Returns:
      the image server used internally by this writer to read the tiles