Package qupath.ext.biop.cellpose
Class OpCreators.ImageNormalizationBuilder
java.lang.Object
qupath.ext.biop.cellpose.OpCreators.ImageNormalizationBuilder
- Enclosing class:
- OpCreators
Builder for a
OpCreators.TileOpCreator
that can be used for image preprocessing
using min/max percentiles or zero-mean-unit-variance normalization.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build aOpCreators.TileOpCreator
according to the builder's parameters.downsample
(double downsample) Specify the downsample factor to use when calculating the normalization.eps
(double eps) Error constant used for numerical stability and avoid dividing by zero.maxDimension
(int maxDimension) The maximum width or height, which is used to calculate a downsample factor for the image ifdownsample(double)
is not specified.percentiles
(double minPercentile, double maxPercentile) Specify min and max percentiles to calculate normalization values.perChannel
(boolean perChannel) Compute the normalization values separately per channel; if false, values are computed jointly across channels.useMask
(boolean useMask) Optionally use any ROI mask provided for the calculation.Normalize for zero mean and unit variance.zeroMeanUnitVariance
(boolean doZeroMeanUnitVariance) Optionally normalize for zero mean and unit variance.
-
Constructor Details
-
ImageNormalizationBuilder
public ImageNormalizationBuilder()
-
-
Method Details
-
percentiles
Specify min and max percentiles to calculate normalization values. SeeImageOps.Normalize.percentile(double, double)
.- Parameters:
minPercentile
-maxPercentile
-- Returns:
- this builder
-
eps
Error constant used for numerical stability and avoid dividing by zero. Default is 1e-6;- Parameters:
eps
-- Returns:
- this builder
-
perChannel
Compute the normalization values separately per channel; if false, values are computed jointly across channels.- Parameters:
perChannel
-- Returns:
- this builder
-
downsample
Specify the downsample factor to use when calculating the normalization. If this is not provided, thenmaxDimension(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
The maximum width or height, which is used to calculate a downsample factor for the image ifdownsample(double)
is not specified.The current default value is 2048;
- Parameters:
maxDimension
-- Returns:
- this builder
-
useMask
Optionally use any ROI mask provided for the calculation. This can restrict the region that is considered.- Parameters:
useMask
-- Returns:
- this builder
-
zeroMeanUnitVariance
Normalize for zero mean and unit variance. This is an alternative to usingpercentiles(double, double)
.- Returns:
- this builder
-
zeroMeanUnitVariance
Optionally normalize for zero mean and unit variance. This is an alternative to usingpercentiles(double, double)
.- Parameters:
doZeroMeanUnitVariance
-- Returns:
- this builder
-
build
Build aOpCreators.TileOpCreator
according to the builder's parameters.- Returns:
- this builder
-