public final class TiffPyramidWriter extends Object implements AutoCloseable
bfconvert/Bio-Formats and read by QuPath, tifffile and libtiff:
SubIFDs tag pointing at its reduced-resolution
pyramid levels (each a self-contained IFD marked NewSubfileType=1);ImageDescription, written at finish(byte[]) once
all planes (and therefore the full dimension sizes) are known.Each plane and all of its pyramid levels are laid out in a single in-memory buffer whose
offsets are computed up front and appended to the file in one write, so the only cross-plane
link that must be patched on disk is the previous plane's next-IFD pointer. Positioned
FileChannel reads make readLevel(org.micromanager.mmomebigtiff.tiff.PlaneLocation, int) safe to call from other threads while writing
proceeds.
| Constructor and Description |
|---|
TiffPyramidWriter(Path file,
PixelType type,
int numLevels,
Compression compression,
ByteOrder order,
double pixelSizeUm) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
finish(byte[] omeXmlUtf8)
Write the OME-XML into the first IFD's ImageDescription and finalize the file.
|
Path |
getFile() |
int |
getNumLevels() |
Object |
readLevel(PlaneLocation loc,
int level)
Read one level's pixels from an already-written plane.
|
PlaneLocation |
writePlane(Object level0Pixels,
int width0,
int height0,
String metadataJson)
Append one full plane and all of its pyramid levels.
|
public TiffPyramidWriter(Path file, PixelType type, int numLevels, Compression compression, ByteOrder order, double pixelSizeUm) throws IOException
IOExceptionpublic Path getFile()
public int getNumLevels()
public PlaneLocation writePlane(Object level0Pixels, int width0, int height0, String metadataJson) throws IOException
level0Pixels - full-resolution primitive pixel arraywidth0 - full-resolution widthheight0 - full-resolution heightmetadataJson - per-image metadata JSON (may be null); embedded in a private tagIOExceptionpublic Object readLevel(PlaneLocation loc, int level) throws IOException
IOExceptionpublic void finish(byte[] omeXmlUtf8)
throws IOException
IOExceptionpublic void close()
close in interface AutoCloseableCopyright © 2026. All rights reserved.