Class SubtractOffsetAndScaleNormalizer
java.lang.Object
qupath.lib.images.servers.transforms.SubtractOffsetAndScaleNormalizer
- All Implemented Interfaces:
BufferedImageOp
,BufferedImageNormalizer
Normalizes the pixel values of a BufferedImage by subtracting and offset and multiplying by a scale factor.
An expected use is to subtract a constant background value in a fluorescence image, with optional channel rescaling.
Note that the result is necessarily clipped to the range of the output data type, and non-integer values are rounded if necessary.
- Since:
- v0.6.0
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(double[] offsets, double[] scales) Create a normalizer that subtracts a constant from each channel, then multiples the result by a scale factor.createScaled
(double... scales) Create a normalizer that scales each channel by a constant.createSubtractOffset
(double... offsets) Create a normalizer that subtracts a constant from each channel, without clipping.createSubtractOffsetAndClipZero
(double... offsets) Create a normalizer that subtracts a constant from each channel, clipping the lower bound to 0.createWithClipRange
(double[] offsets, double[] scales, double minClip, double maxClip) Create a normalizer that subtracts a constant from each channel, then multiples the result by a scale factor - clipping the result to a defined range.filter
(BufferedImage img, BufferedImage output) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface qupath.lib.images.servers.transforms.BufferedImageNormalizer
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints
-
Method Details
-
createScaled
Create a normalizer that scales each channel by a constant.- Parameters:
scales
-- Returns:
-
createSubtractOffset
Create a normalizer that subtracts a constant from each channel, without clipping.- Parameters:
offsets
-- Returns:
-
createSubtractOffsetAndClipZero
Create a normalizer that subtracts a constant from each channel, clipping the lower bound to 0.- Parameters:
offsets
-- Returns:
-
create
Create a normalizer that subtracts a constant from each channel, then multiples the result by a scale factor. The result is not clipped.- Parameters:
offsets
-scales
-- Returns:
-
createWithClipRange
public static SubtractOffsetAndScaleNormalizer createWithClipRange(double[] offsets, double[] scales, double minClip, double maxClip) Create a normalizer that subtracts a constant from each channel, then multiples the result by a scale factor - clipping the result to a defined range.- Parameters:
offsets
-scales
-minClip
-maxClip
-- Returns:
-
filter
- Specified by:
filter
in interfaceBufferedImageOp
-