public final class OMEBigTiffStorage extends Object implements MultiresOMEBigTiffAPI
org.micromanager.mmomezarr.OMEZarrStorage / NDTiffStorage: a single writer
thread drains a bounded queue (back-pressure), images are readable from an in-memory
write-pending buffer the instant they are queued, and every plane is written together with its
downsampled pyramid levels as TIFF SubIFDs.
The dataset is a folder containing one self-contained pyramidal OME-BigTIFF file per stage
position, an append-only per-image metadata sidecar (ome-metadata.ndjson), and a small
MM-specific descriptor (mm-bigtiff.json) used to reconstruct axis names/types and
summary/custom metadata on reopen. Each .ome.tif file is independently readable by any
OME-TIFF reader (QuPath, Bio-Formats, tifffile, ImageJ).
Pyramid note: because a plane's SubIFD array is written inline with the plane, the
number of resolution levels is fixed once the first image is written; setMaxResolutionLevel(int) therefore only raises the level count before writing begins.
| Constructor and Description |
|---|
OMEBigTiffStorage(String dir,
String name,
String summaryMetadataJson,
OMEBigTiffStorageConfig config)
Create a new dataset for writing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkForWritingException()
Re-throw any exception that occurred on the writer thread.
|
void |
close()
Release all resources.
|
void |
closeAndWait()
Release all resources and block until done.
|
void |
finishedWriting()
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.
|
String |
getCustomMetadata(String key)
Retrieve a custom-metadata blob previously stored under
key, or null. |
String |
getDiskLocation()
Path to the dataset root folder, or null if not on disk.
|
EssentialImageMetadata |
getEssentialImageMetadata(Map<String,Object> axes)
Essential metadata (width/height/bitDepth/rgb) without loading pixels.
|
EssentialImageMetadata |
getEssentialImageMetadata(Map<String,Object> axes,
int level)
Essential metadata at the given resolution level.
|
OMEBigTiffImage |
getImage(Map<String,Object> axes)
Get a single image (resolution level 0).
|
OMEBigTiffImage |
getImage(Map<String,Object> axes,
int level)
Get a single image at the given resolution level.
|
int[] |
getImageBounds()
[xMin, yMin, xMax, yMax] pixel bounds of acquired data.
|
String |
getImageMetadata(Map<String,Object> axes)
Get per-image metadata JSON for the image with the given axes, or null.
|
int |
getNumResLevels()
Number of resolution levels currently in the pyramid.
|
OMEBigTiffImage |
getRegion(Map<String,Object> axes,
int level,
long x,
long y,
int w,
int h)
Read a rectangular region of a tiled plane at the given resolution level, touching only the
covering tiles.
|
String |
getSummaryMetadata()
The dataset summary metadata as a JSON string (supplied at construction), or null.
|
String |
getUniqueAcqName()
A unique name for this dataset instance.
|
int |
getWritingQueueTaskMaxSize()
Maximum size of the writer queue.
|
int |
getWritingQueueTaskSize()
Number of images waiting in the writer queue.
|
boolean |
hasImage(Map<String,Object> axes)
Whether an image with the given axes exists.
|
boolean |
hasImage(Map<String,Object> axes,
int level)
Whether an image exists at the given resolution level.
|
boolean |
isFinished()
Whether the dataset is finished writing and now read-only.
|
static OMEBigTiffStorage |
load(String dir)
Open an existing dataset for reading.
|
static OMEBigTiffStorage |
load(String dir,
OMEBigTiffStorageConfig config)
Open an existing dataset for reading with a custom config.
|
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).
|
Future<Void> |
putTile(Object tilePixels,
String metadataJson,
Map<String,Object> axes,
int tileCol,
int tileRow,
boolean rgb,
int bitDepth)
Write one tile of a plane (tiled mode only; requires a full plane size declared via
OMEBigTiffStorageConfig.fullPlaneSize(long, long)). |
void |
setCustomMetadata(String key,
String json)
Store an arbitrary custom-metadata blob under
key. |
void |
setMaxResolutionLevel(int newNumLevels)
Ensure the pyramid has at least this many levels.
|
public OMEBigTiffStorage(String dir, String name, String summaryMetadataJson, OMEBigTiffStorageConfig config)
dir - parent directoryname - dataset name (a .ome.tiff folder is created under dir)summaryMetadataJson - opaque summary metadata JSON (may be null)config - storage configuration (may be null for defaults)public static OMEBigTiffStorage load(String dir)
public static OMEBigTiffStorage load(String dir, OMEBigTiffStorageConfig config)
public Future<Void> putImage(Object pixels, String metadataJson, Map<String,Object> axes, boolean rgb, int bitDepth, int imageHeight, int imageWidth)
OMEBigTiffAPIputImage in interface OMEBigTiffAPIpixels - 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 pixelspublic Future<Void> putTile(Object tilePixels, String metadataJson, Map<String,Object> axes, int tileCol, int tileRow, boolean rgb, int bitDepth)
OMEBigTiffStorageConfig.fullPlaneSize(long, long)). The tile pixel array must hold exactly
tileWidth*tileHeight samples; edge tiles are zero-padded by the caller.tilePixels - primitive pixel array of length tileWidth*tileHeightmetadataJson - per-plane metadata JSON (recorded once per plane; may be null)axes - axes identifying the plane this tile belongs totileCol - tile column (0-based) within the planetileRow - tile row (0-based) within the planergb - whether the image is RGB (unsupported)bitDepth - bits per sample (8/12/16/32)public int getNumResLevels()
MultiresOMEBigTiffAPIgetNumResLevels in interface MultiresOMEBigTiffAPIpublic void setMaxResolutionLevel(int newNumLevels)
MultiresOMEBigTiffAPIIllegalStateException.setMaxResolutionLevel in interface MultiresOMEBigTiffAPInewNumLevels - desired number of resolution levels (>= current)public OMEBigTiffImage getImage(Map<String,Object> axes)
OMEBigTiffAPIgetImage in interface OMEBigTiffAPIpublic OMEBigTiffImage getImage(Map<String,Object> axes, int level)
MultiresOMEBigTiffAPIgetImage in interface MultiresOMEBigTiffAPIpublic OMEBigTiffImage getRegion(Map<String,Object> axes, int level, long x, long y, int w, int h)
level pixels.public String getImageMetadata(Map<String,Object> axes)
OMEBigTiffAPIgetImageMetadata in interface OMEBigTiffAPIpublic EssentialImageMetadata getEssentialImageMetadata(Map<String,Object> axes)
OMEBigTiffAPIgetEssentialImageMetadata in interface OMEBigTiffAPIpublic EssentialImageMetadata getEssentialImageMetadata(Map<String,Object> axes, int level)
MultiresOMEBigTiffAPIgetEssentialImageMetadata in interface MultiresOMEBigTiffAPIpublic boolean hasImage(Map<String,Object> axes)
OMEBigTiffAPIhasImage in interface OMEBigTiffAPIpublic boolean hasImage(Map<String,Object> axes, int level)
MultiresOMEBigTiffAPIhasImage in interface MultiresOMEBigTiffAPIpublic Set<Map<String,Object>> getAxesSet()
OMEBigTiffAPIgetAxesSet in interface OMEBigTiffAPIpublic String getSummaryMetadata()
OMEBigTiffAPIgetSummaryMetadata in interface OMEBigTiffAPIpublic void setCustomMetadata(String key, String json)
OMEBigTiffAPIkey.setCustomMetadata in interface OMEBigTiffAPIpublic String getCustomMetadata(String key)
OMEBigTiffAPIkey, or null.getCustomMetadata in interface OMEBigTiffAPIpublic boolean isFinished()
OMEBigTiffAPIisFinished in interface OMEBigTiffAPIpublic void checkForWritingException()
throws Exception
OMEBigTiffAPIcheckForWritingException in interface OMEBigTiffAPIExceptionpublic void finishedWriting()
OMEBigTiffAPIfinishedWriting in interface OMEBigTiffAPIpublic String getDiskLocation()
OMEBigTiffAPIgetDiskLocation in interface OMEBigTiffAPIpublic String getUniqueAcqName()
OMEBigTiffAPIgetUniqueAcqName in interface OMEBigTiffAPIpublic int getWritingQueueTaskSize()
OMEBigTiffAPIgetWritingQueueTaskSize in interface OMEBigTiffAPIpublic int getWritingQueueTaskMaxSize()
OMEBigTiffAPIgetWritingQueueTaskMaxSize in interface OMEBigTiffAPIpublic void close()
OMEBigTiffAPIclose in interface AutoCloseableclose in interface OMEBigTiffAPIpublic void closeAndWait()
throws InterruptedException
OMEBigTiffAPIcloseAndWait in interface OMEBigTiffAPIInterruptedExceptionpublic int[] getImageBounds()
OMEBigTiffAPIgetImageBounds in interface OMEBigTiffAPICopyright © 2026. All rights reserved.