Class OMEPyramidWriter.Builder

java.lang.Object
qupath.lib.images.writers.ome.OMEPyramidWriter.Builder
Enclosing class:
OMEPyramidWriter

public static class OMEPyramidWriter.Builder extends Object
Builder class to define parameters when exporting an image region as OME-TIFF, possibly as an image pyramid.
Author:
Pete Bankhead
  • Constructor Details

    • Builder

      public Builder(ImageServer<BufferedImage> server)
      Constructor.
      Parameters:
      server - the ImageServer from which pixels will be requested and written to the OME-TIFF.
  • Method Details

    • channelsPlanar

      public OMEPyramidWriter.Builder channelsPlanar()
      Request that channels are written as separate image planes.
      Returns:
      this builder
    • channelsInterleaved

      public OMEPyramidWriter.Builder channelsInterleaved()
      Request that channels are written interleaved within a single image plane.
      Returns:
      this builder
    • channelsImages

      public OMEPyramidWriter.Builder channelsImages()
      Request that channels are written as separate images.
      Returns:
      this builder
    • bigTiff

      public OMEPyramidWriter.Builder bigTiff()
      Request that the image is written in BigTIFF format.
      Returns:
      this builder
    • bigTiff

      public OMEPyramidWriter.Builder bigTiff(boolean doBigTiff)
      Specify whether the image should be written in BigTIFF format.
      Parameters:
      doBigTiff - if true, request that big-tiff is written
      Returns:
      this builder
    • compression

      Request the output compression type.
      Parameters:
      compression -
      Returns:
      this builder
    • lossyCompression

      public OMEPyramidWriter.Builder lossyCompression()
      Request the default lossy compression method. Not all servers support lossy compression (e.g. non-RGB servers).
      Returns:
      this builder
    • losslessCompression

      public OMEPyramidWriter.Builder losslessCompression()
      Request the default lossless compression method.
      Returns:
    • uncompressed

      public OMEPyramidWriter.Builder uncompressed()
      Request no compression.
      Returns:
      Since:
      v0.4.0
    • parallelize

      public OMEPyramidWriter.Builder parallelize()
      Parallelize tile export, if possible.
      Returns:
      this builder
    • parallelize

      public OMEPyramidWriter.Builder parallelize(boolean doParallel)
      Specify if tile export should be parallelized if possible, with the default number of threads (current 4).
      Parameters:
      doParallel -
      Returns:
      See Also:
    • parallelize

      public OMEPyramidWriter.Builder parallelize(int nThreads)
      Specify if tile export should be parallelized if possible, with the requested number of threads.

      Note that increasing the number of threads may not give improved performance, since it I/O and compression may well become a bottleneck. The main purpose of this option is to parallelize requesting and writing tiles, which can be achieved with just a few threads.

      Parameters:
      nThreads - number of threads for parallel export; use ≤ 1 to turn off parallelization.
      Returns:
      Since:
      v0.4.0
    • pixelType

      public OMEPyramidWriter.Builder pixelType(PixelType exportPixelType)
      Specify the output PixelType.
      Parameters:
      exportPixelType -
      Returns:
    • pixelType

      public OMEPyramidWriter.Builder pixelType(String exportPixelType)
      Specify the output PixelType as a String, e.g. "UINT8", "FLOAT32" etc.
      Parameters:
      exportPixelType -
      Returns:
    • allZSlices

      public OMEPyramidWriter.Builder allZSlices()
      Request that all z-slices are exported.
      Returns:
      this builder
    • zSlice

      public OMEPyramidWriter.Builder zSlice(int z)
      Specify the z-slice to export.
      Parameters:
      z -
      Returns:
      this builder
    • zSlices

      public OMEPyramidWriter.Builder zSlices(int zStart, int zEnd)
      Specify the start (inclusive) and end (exclusive) z-slices.
      Parameters:
      zStart -
      zEnd -
      Returns:
      this builder
    • timePoint

      public OMEPyramidWriter.Builder timePoint(int t)
      Specify a single timepoint to be written from a time series.
      Parameters:
      t - the index identifying the requested timepoint
      Returns:
      this builder
    • allTimePoints

      public OMEPyramidWriter.Builder allTimePoints()
      Request that all timepoints of a time series will be written.
      Returns:
      this builder
    • timePoints

      public OMEPyramidWriter.Builder timePoints(int tStart, int tEnd)
      Specify a range of timepoints to be written from a time series.
      Parameters:
      tStart - first timepoint (inclusive)
      tEnd - last timepoint (exclusive)
      Returns:
      this builder
    • name

      public OMEPyramidWriter.Builder name(String name)
      Specify a series name
      Parameters:
      name -
      Returns:
      this builder
    • region

      public OMEPyramidWriter.Builder region(int x, int y, int width, int height)
      Define the region to export based on a bounding box.
      Parameters:
      x -
      y -
      width -
      height -
      Returns:
      this builder
    • region

      public OMEPyramidWriter.Builder region(ImageRegion region)
      Define the region to export, including the z-slice and time point.
      Parameters:
      region -
      Returns:
      this builder
      See Also:
    • tileSize

      public OMEPyramidWriter.Builder tileSize(int tileSize)
      Define the requested tile size (width == height).

      This is only a suggestion, and the OME reader may override it if the value is unsupported.

      Parameters:
      tileSize -
      Returns:
      this builder
    • tileSize

      public OMEPyramidWriter.Builder tileSize(int tileWidth, int tileHeight)
      Define the requested tile width and height.

      This is only a suggestion, and the OME reader may override it if the value is unsupported.

      Parameters:
      tileWidth -
      tileHeight -
      Returns:
      this builder
    • downsamples

      public OMEPyramidWriter.Builder downsamples(double... downsamples)
      Specify downsample factors to use in the final pyramid.

      Note that the downsample values provided will be sorted in ascending order.

      Parameters:
      downsamples -
      Returns:
      this builder
    • dyadicDownsampling

      public OMEPyramidWriter.Builder dyadicDownsampling()
      Downsample by factors of 2.

      Note that the highest downsample value will depend on the tile size, so the tile size should be set first.

      Returns:
      this builder
      See Also:
    • scaledDownsampling

      public OMEPyramidWriter.Builder scaledDownsampling(double scale)
      Downsample by specific increasing factor each time (e.g. if scale == 2, then downsamples will be 1, 2, 4, 8...).

      Note that the highest downsample value will depend on the tile size, so the tile size should be set first.

      Parameters:
      scale -
      Returns:
      this builder
      See Also:
    • scaledDownsampling

      public OMEPyramidWriter.Builder scaledDownsampling(double minDownsample, double scale)
      Downsample by specific increasing factor each time, with a specified initial downsample value (e.g. if scale == 2, then downsamples will be minDownsample, minDownsample*2, minDownsample*4...).

      Note that the highest downsample value will depend on the tile size, so the tile size should be set first.

      Parameters:
      minDownsample - the starting downsample, defining the highest-resolution image (usually 1.0)
      scale - the scale used to define successive downsamples
      Returns:
      this builder
      See Also:
    • channels

      public OMEPyramidWriter.Builder channels(int... channels)
      Override default of writing all channels in their original order to be able to specify which channels are output, and in which order.
      Parameters:
      channels - zero-based channel indices for all channels that should be exported, in the desired export order.
      Returns:
      this builder
    • build

      Create an OMEPyramidWriter.OMEPyramidSeries to write the OME-TIFF.
      Returns:
      the series