Skip to content

Commit

Permalink
Add --no-tiles option to write metadata only
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed Oct 2, 2024
1 parent ece12b6 commit 6f612a5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/java/com/glencoesoftware/bioformats2raw/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public class Converter implements Callable<Integer> {
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();
Expand Down Expand Up @@ -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".
*
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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];

Expand Down

0 comments on commit 6f612a5

Please sign in to comment.