Class OMEZarrWriter
- All Implemented Interfaces:
AutoCloseable
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.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this writer.qupath.lib.images.servers.ImageServer<BufferedImage> Get the image server used internally by this writer to read the tiles.voidWrite the entire image in a background thread.voidwriteTile(qupath.lib.images.servers.TileRequest tileRequest) Write the provided tile in a background thread.
-
Method Details
-
close
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:
closein interfaceAutoCloseable- 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(qupath.lib.images.servers.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, theTileRequestManagerof the internal image server may be different from the one of the provided image server, so functions likeTileRequestManager.getAllTileRequests()may not return the expected tiles. Use theTileRequestManagerofgetReaderServer()to get accurate tiles.- Parameters:
tileRequest- the tile to write
-
getReaderServer
Get the image server used internally by this writer to read the tiles. It can be different from the one given inBuilder(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
-