Package org.micromanager.mmomezarr
Interface OMEZarrAPI
-
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
MultiresOMEZarrAPI
- All Known Implementing Classes:
OMEZarrStorage
public interface OMEZarrAPI extends AutoCloseable
Minimal storage API for streaming multi-dimensional images to OME-Zarr, modeled onorg.micromanager.ndtiffstorage.NDTiffAPI. Multi-resolution/pyramid operations live inMultiresOMEZarrAPI.Images are addressed by an axes map (
axisName -> Integer|String). Writing is asynchronous on a dedicated thread;putImage(java.lang.Object, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, boolean, int, int, int)returns aFuturethat completes when the image is durably written. Reads are served immediately from an in-memory write-pending buffer and fall back to disk, so reading during acquisition is safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckForWritingException()Re-throw any exception that occurred on the writer thread.voidclose()Release all resources.voidcloseAndWait()Release all resources and block until done.voidfinishedWriting()Signal that no more images will be written; the dataset becomes read-only.Set<Map<String,Object>>getAxesSet()The set of axis positions for every image in the dataset.StringgetCustomMetadata(String key)Retrieve a custom-metadata blob previously stored underkey, or null.StringgetDiskLocation()Path to the dataset root folder, or null if not on disk.EssentialImageMetadatagetEssentialImageMetadata(Map<String,Object> axes)Essential metadata (width/height/bitDepth/rgb) without loading pixels.OMEZarrImagegetImage(Map<String,Object> axes)Get a single image (resolution level 0).int[]getImageBounds()[xMin, yMin, xMax, yMax] pixel bounds of acquired data.StringgetImageMetadata(Map<String,Object> axes)Get per-image metadata JSON for the image with the given axes, or null.StringgetSummaryMetadata()The dataset summary metadata as a JSON string (supplied at construction), or null.StringgetUniqueAcqName()A unique name for this dataset instance.intgetWritingQueueTaskMaxSize()Maximum size of the writer queue.intgetWritingQueueTaskSize()Number of images waiting in the writer queue.booleanhasImage(Map<String,Object> axes)Whether an image with the given axes exists.booleanisFinished()Whether the dataset is finished writing and now read-only.Future<Void>putImage(Object pixels, String metadataJson, Map<String,Object> axes, boolean rgb, int bitDepth, int imageHeight, int imageWidth)Add an image to storage (resolution level 0).voidsetCustomMetadata(String key, String json)Store an arbitrary custom-metadata blob underkeyin the root group.
-
-
-
Method Detail
-
putImage
Future<Void> putImage(Object pixels, String metadataJson, Map<String,Object> axes, boolean rgb, int bitDepth, int imageHeight, int imageWidth)
Add an image to storage (resolution level 0).- Parameters:
pixels- primitive pixel array (byte[],short[],float[])metadataJson- per-image metadata as a JSON string (may be null)axes- axis name to position (Integer or String)rgb- whether the image is RGB (unsupported in v1)bitDepth- bits per pixel component (8/16/32)imageHeight- image height in pixelsimageWidth- image width in pixels- Returns:
- a future completing when the image is written
-
isFinished
boolean isFinished()
Whether the dataset is finished writing and now read-only.
-
checkForWritingException
void checkForWritingException() throws ExceptionRe-throw any exception that occurred on the writer thread.- Throws:
Exception
-
getSummaryMetadata
String getSummaryMetadata()
The dataset summary metadata as a JSON string (supplied at construction), or null.
-
setCustomMetadata
void setCustomMetadata(String key, String json)
Store an arbitrary custom-metadata blob underkeyin the root group.
-
getCustomMetadata
String getCustomMetadata(String key)
Retrieve a custom-metadata blob previously stored underkey, or null.
-
finishedWriting
void finishedWriting()
Signal that no more images will be written; the dataset becomes read-only.
-
getDiskLocation
String getDiskLocation()
Path to the dataset root folder, or null if not on disk.
-
getUniqueAcqName
String getUniqueAcqName()
A unique name for this dataset instance.
-
getImageBounds
int[] getImageBounds()
[xMin, yMin, xMax, yMax] pixel bounds of acquired data.
-
getImage
OMEZarrImage getImage(Map<String,Object> axes)
Get a single image (resolution level 0).
-
getImageMetadata
String getImageMetadata(Map<String,Object> axes)
Get per-image metadata JSON for the image with the given axes, or null.
-
getEssentialImageMetadata
EssentialImageMetadata getEssentialImageMetadata(Map<String,Object> axes)
Essential metadata (width/height/bitDepth/rgb) without loading pixels.
-
getAxesSet
Set<Map<String,Object>> getAxesSet()
The set of axis positions for every image in the dataset.
-
getWritingQueueTaskSize
int getWritingQueueTaskSize()
Number of images waiting in the writer queue.
-
getWritingQueueTaskMaxSize
int getWritingQueueTaskMaxSize()
Maximum size of the writer queue.
-
close
void close()
Release all resources.- Specified by:
closein interfaceAutoCloseable
-
closeAndWait
void closeAndWait() throws InterruptedExceptionRelease all resources and block until done.- Throws:
InterruptedException
-
-