Package qupath.lib.images.servers
Class TransformedServerBuilder
java.lang.Object
qupath.lib.images.servers.TransformedServerBuilder
Helper class for creating an
ImageServer
that applies one or more transforms to another (wrapped) ImageServer
.
Note: This is an early-stage experimental class, which may well change!
- Author:
- Pete Bankhead
-
Constructor Summary
ConstructorDescriptionTransformedServerBuilder
(ImageServer<BufferedImage> baseServer) Create a transformedImageServer
. -
Method Summary
Modifier and TypeMethodDescriptionPerform an average (mean) projection of the channels.build()
Get theImageServer
that applies all the requested transforms.concatChannels
(Collection<ImageServer<BufferedImage>> additionalChannels) Concatenate a collection of additional servers along the 'channels' dimension (iteration order is used).concatChannels
(ImageServer<BufferedImage>... additionalChannels) Concatenate additional servers along the 'channels' dimension.crop
(ImageRegion region) Crop an specified region based on a bounding box.deconvolveStains
(ColorDeconvolutionStains stains, int... stainNumbers) Apply color deconvolution to the brightfield image, so that deconvolved stains behave as separate channels/extractChannels
(int... channels) Extract specified channels for an image.extractChannels
(String... names) Extract specified channels for an image.Perform a maximum projection of the channels.Perform a minimum projection of the channels.reorderRGB
(String order) Rearrange the channel order of an RGB image.rotate
(RotatedImageServer.Rotation rotation) Rotate the image, using an increment of 90 degrees.transform
(AffineTransform transform) Apply anAffineTransform
to the server.
-
Constructor Details
-
TransformedServerBuilder
Create a transformedImageServer
.- Parameters:
baseServer
- the initial server that will be transformed.
-
-
Method Details
-
crop
Crop an specified region based on a bounding box.- Parameters:
region
-- Returns:
-
transform
Apply anAffineTransform
to the server. Note that the transform must be invertible, otherwise andIllegalArgumentException
will be thrown.- Parameters:
transform
-- Returns:
-
deconvolveStains
public TransformedServerBuilder deconvolveStains(ColorDeconvolutionStains stains, int... stainNumbers) Apply color deconvolution to the brightfield image, so that deconvolved stains behave as separate channels/- Parameters:
stains
- the stains to apply for color deconvolutionstainNumbers
- the indices of the stains that should be use (an array compressing values that are 1, 2 or 3); if not specified, all 3 stains will be used.- Returns:
-
reorderRGB
Rearrange the channel order of an RGB image. This is intended for cases where an image has wrongly been interpreted as RGB or BGR.- Parameters:
order
-- Returns:
-
rotate
Rotate the image, using an increment of 90 degrees.- Parameters:
rotation
-- Returns:
-
extractChannels
Extract specified channels for an image.- Parameters:
channels
- indices (0-based) of channels to extract.- Returns:
-
extractChannels
Extract specified channels for an image.- Parameters:
names
- names of channels to extract.- Returns:
-
maxChannelProject
Perform a maximum projection of the channels.- Returns:
-
averageChannelProject
Perform an average (mean) projection of the channels.- Returns:
-
minChannelProject
Perform a minimum projection of the channels.- Returns:
-
concatChannels
public TransformedServerBuilder concatChannels(Collection<ImageServer<BufferedImage>> additionalChannels) Concatenate a collection of additional servers along the 'channels' dimension (iteration order is used).- Parameters:
additionalChannels
- additional servers that will be applied as channels; note that these should be of an appropriate type and dimension for concatenation.- Returns:
-
concatChannels
Concatenate additional servers along the 'channels' dimension.- Parameters:
additionalChannels
- additional servers from which channels will be added; note that the servers should be of an appropriate type and dimension for concatenation.- Returns:
-
build
Get theImageServer
that applies all the requested transforms.- Returns:
-