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 TypeMethodDescriptionvoid
close()
Close this writer.Get the image server used internally by this writer to read the tiles.void
Write the entire image in a background thread.void
writeTile
(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:
close
in 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
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, theTileRequestManager
of 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 theTileRequestManager
ofgetReaderServer()
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
-