Package qupath.lib.images.servers
Class ColorTransforms
java.lang.Object
qupath.lib.images.servers.ColorTransforms
Color transforms that may be used to extract single-channel images from BufferedImages.
These are JSON-serializable, and therefore can be used with pixel classifiers.
- Author:
- Pete Bankhead
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface defining a color transform that can extract a float values from a BufferedImage.static class
TypeAdapter
to support serializing aColorTransforms.ColorTransform
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateChannelExtractor
(int channel) Create ColorTransform to extract a channel based on its number (0-based index, although result ofColorTransforms.ColorTransform.getName()
is 1-based).createChannelExtractor
(String channelName) Create ColorTransform to extract a channel based on its name.createColorDeconvolvedChannel
(ColorDeconvolutionStains stains, int stainNumber) Create a ColorTransform that applies color deconvolution.Create a ColorTransform that calculates the maximum of all channels.Create a ColorTransform that calculates the mean of all channels.Create a ColorTransform that calculates the minimum of all channels.
-
Constructor Details
-
ColorTransforms
public ColorTransforms()
-
-
Method Details
-
createChannelExtractor
Create ColorTransform to extract a channel based on its number (0-based index, although result ofColorTransforms.ColorTransform.getName()
is 1-based).- Parameters:
channel
-- Returns:
-
createChannelExtractor
Create ColorTransform to extract a channel based on its name.- Parameters:
channelName
-- Returns:
-
createMeanChannelTransform
Create a ColorTransform that calculates the mean of all channels.- Returns:
-
createColorDeconvolvedChannel
public static ColorTransforms.ColorTransform createColorDeconvolvedChannel(ColorDeconvolutionStains stains, int stainNumber) Create a ColorTransform that applies color deconvolution.- Parameters:
stains
- the stains (this will be 'fixed', and not adapted for each image)stainNumber
- number of the stain (1, 2 or 3)- Returns:
-
createMaximumChannelTransform
Create a ColorTransform that calculates the maximum of all channels.- Returns:
-
createMinimumChannelTransform
Create a ColorTransform that calculates the minimum of all channels.- Returns:
-