Skip to content

Commit

Permalink
Merge pull request qupath#863 from petebankhead/ome-writing
Browse files Browse the repository at this point in the history
OMEPyramidWriter and ConvertCommand improvements
  • Loading branch information
petebankhead authored Dec 15, 2021
2 parents 48dfb82 + 5d8c43a commit 4b464e5
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 53 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ List of bugs fixed:
* 'Automate -> Show workflow command history' displays empty workflow (https://github.com/qupath/qupath/pull/851)
* Extensions are sometimes loaded too late when running command line scripts (https://github.com/qupath/qupath/issues/852)
* ICC Profiles could not be set in the viewer (unused preview feature, https://github.com/qupath/qupath/pull/850)
* convert-ome command doesn't report when it is finished (https://github.com/qupath/qupath/issues/859)
* Image writing fixes, including
* convert-ome command doesn't report when it is finished (https://github.com/qupath/qupath/issues/859)
* OMEPyramidWriter ignores file extension to always write ome.tif (https://github.com/qupath/qupath/issues/857)
* OMEPyramidWriter logic for bigtiff can fail for image pyramids (https://github.com/qupath/qupath/issues/858)

### Dependency updates
* JavaFX 17.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import qupath.lib.images.servers.bioformats.BioFormatsServerBuilder;
import qupath.lib.images.writers.ome.OMEPyramidWriter.Builder;
import qupath.lib.images.writers.ome.OMEPyramidWriter.CompressionType;
import qupath.lib.regions.RegionRequest;

/**
* Allows command line option to convert an input image to OME-TIFF
Expand Down Expand Up @@ -81,6 +80,10 @@ public class ConvertCommand implements Runnable, Subcommand {
"Each pyramidal level is scaled down by the specified factor (> 1)."})
private double pyramid;

@Option(names = {"--big-tiff"}, defaultValue = Option.NULL_VALUE, description = {"Request to write a big tiff, which is required when writing a TIFF images > 4GB.",
"Default is to automatically decide based on image size. Choose --big-tiff=false to force a non-big-tiff to be written."})
private Boolean bigTiff;

@Option(names = {"--tile-size"}, defaultValue = "-1", description = "Set the tile size (of equal height and width).")
private int tileSize;

Expand Down Expand Up @@ -170,6 +173,9 @@ public void run() {
.tileSize(tileWidth, tileHeight)
.parallelize(parallelize);

if (bigTiff != null)
builder = builder.bigTiff(bigTiff.booleanValue());

// Make pyramidal, if requested
if (downsample < 1)
downsample = server.getDownsampleForResolution(0);
Expand Down Expand Up @@ -239,7 +245,7 @@ else if (tStart > tEnd) {
}
}

builder.build().writePyramid(outputFile.getPath());
builder.build().writeSeries(outputFile.getPath());

long duration = System.currentTimeMillis() - startTime;
logger.info(String.format("%s written in %.1f seconds", outputFile.getAbsolutePath(), duration/1000.0));
Expand Down
Loading

0 comments on commit 4b464e5

Please sign in to comment.