Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --no-tiles option to write metadata only #259

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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