From 6f612a57022f003691421314298d34bbc2afea7c Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Wed, 2 Oct 2024 12:46:40 -0500 Subject: [PATCH] Add `--no-tiles` option to write metadata only --- .../bioformats2raw/Converter.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java index ca54f63..d2f770e 100644 --- a/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java +++ b/src/main/java/com/glencoesoftware/bioformats2raw/Converter.java @@ -167,6 +167,7 @@ public class Converter implements Callable { private volatile boolean noRootGroup = false; private volatile boolean reuseExistingResolutions = false; private volatile int minSize; + private volatile boolean writeImageData = true; /** Scaling implementation that will be used during downsampling. */ private volatile IImageScaler scaler = new SimpleImageScaler(); @@ -374,6 +375,20 @@ public void setChunkDepth(int depth) { } } + /** + * Set whether or not tiles should actually be converted. + * + * @param noTiles true if tiles should not be converted + */ + @Option( + names = {"--no-tiles"}, + description = "Write all metadata, but do not convert any tiles", + defaultValue = "false" + ) + public void setNoTiles(boolean noTiles) { + writeImageData = !noTiles; + } + /** * Set the slf4j logging level. Defaults to "WARN". * @@ -930,6 +945,13 @@ public int getChunkDepth() { return chunkDepth; } + /** + * @return true if image data will not be converted + */ + public boolean getNoTiles() { + return !writeImageData; + } + /** * @return slf4j logging level */ @@ -2132,6 +2154,10 @@ public void saveResolutions(int series) compressionType.toString(), compressionProperties)); ZarrArray.create(getRootPath().resolve(resolutionString), arrayParams); + if (!writeImageData) { + continue; + } + nTile = new AtomicInteger(0); tileCount = resTileCounts[resolution];