Class OpCreators.ImageNormalizationBuilder

java.lang.Object
qupath.ext.biop.cellpose.OpCreators.ImageNormalizationBuilder
Enclosing class:
OpCreators

public static class OpCreators.ImageNormalizationBuilder extends Object
Builder for a OpCreators.TileOpCreator that can be used for image preprocessing using min/max percentiles or zero-mean-unit-variance normalization.
  • Constructor Details

    • ImageNormalizationBuilder

      public ImageNormalizationBuilder()
  • Method Details

    • percentiles

      public OpCreators.ImageNormalizationBuilder percentiles(double minPercentile, double maxPercentile)
      Specify min and max percentiles to calculate normalization values. See ImageOps.Normalize.percentile(double, double).
      Parameters:
      minPercentile -
      maxPercentile -
      Returns:
      this builder
    • eps

      public OpCreators.ImageNormalizationBuilder eps(double eps)
      Error constant used for numerical stability and avoid dividing by zero. Default is 1e-6;
      Parameters:
      eps -
      Returns:
      this builder
    • perChannel

      public OpCreators.ImageNormalizationBuilder perChannel(boolean perChannel)
      Compute the normalization values separately per channel; if false, values are computed jointly across channels.
      Parameters:
      perChannel -
      Returns:
      this builder
    • downsample

      public OpCreators.ImageNormalizationBuilder downsample(double downsample)
      Specify the downsample factor to use when calculating the normalization. If this is not provided, then maxDimension(int) will be used to calculate a downsample value automatically.

      The downsample should be ≥ 1.0 and high enough to ensure that the entire image can be fit in memory. A downsample of 1.0 for a whole slide image will probably fail due to memory or array size limits.

      Parameters:
      downsample -
      Returns:
      this builder see maxDimension(int)
    • maxDimension

      public OpCreators.ImageNormalizationBuilder maxDimension(int maxDimension)
      The maximum width or height, which is used to calculate a downsample factor for the image if downsample(double) is not specified.

      The current default value is 2048;

      Parameters:
      maxDimension -
      Returns:
      this builder
    • useMask

      public OpCreators.ImageNormalizationBuilder useMask(boolean useMask)
      Optionally use any ROI mask provided for the calculation. This can restrict the region that is considered.
      Parameters:
      useMask -
      Returns:
      this builder
    • zeroMeanUnitVariance

      public OpCreators.ImageNormalizationBuilder zeroMeanUnitVariance()
      Normalize for zero mean and unit variance. This is an alternative to using percentiles(double, double).
      Returns:
      this builder
    • zeroMeanUnitVariance

      public OpCreators.ImageNormalizationBuilder zeroMeanUnitVariance(boolean doZeroMeanUnitVariance)
      Optionally normalize for zero mean and unit variance. This is an alternative to using percentiles(double, double).
      Parameters:
      doZeroMeanUnitVariance -
      Returns:
      this builder
    • build

      public OpCreators.TileOpCreator build()
      Build a OpCreators.TileOpCreator according to the builder's parameters.
      Returns:
      this builder