Class OMEZarrWriter

java.lang.Object
qupath.lib.images.writers.ome.zarr.OMEZarrWriter
All Implemented Interfaces:
AutoCloseable

public class OMEZarrWriter extends Object implements AutoCloseable
Create 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 thread-safe but already uses concurrency internally to write tiles.

This writer has to be closed once no longer used.

  • Method Details

    • close

      public void close() throws InterruptedException
      Close this writer. This will wait until all pending tiles are written.

      If this function is interrupted, all pending and active tasks are cancelled.

      Specified by:
      close in interface AutoCloseable
      Throws:
      InterruptedException - if the waiting is interrupted
    • writeImage

      public void writeImage()
      Write the entire image in a background thread.

      The image will be written from an internal pool of thread, so this function may return before the image is actually written.

    • writeTile

      public void writeTile(TileRequest tileRequest)
      Write the provided tile in a background thread.

      The tile will be written from an internal pool of thread, so this function may return before the tile is actually written.

      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
    • 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