Class ColorTransforms

java.lang.Object
qupath.lib.images.servers.ColorTransforms

public class ColorTransforms extends Object
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
  • Constructor Details

    • ColorTransforms

      public ColorTransforms()
  • Method Details

    • createChannelExtractor

      public static ColorTransforms.ColorTransform createChannelExtractor(int channel)
      Create ColorTransform to extract a channel based on its number (0-based index, although result of ColorTransforms.ColorTransform.getName() is 1-based).
      Parameters:
      channel -
      Returns:
    • createChannelExtractor

      public static ColorTransforms.ColorTransform createChannelExtractor(String channelName)
      Create ColorTransform to extract a channel based on its name.
      Parameters:
      channelName -
      Returns:
    • createMeanChannelTransform

      public static ColorTransforms.ColorTransform 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

      public static ColorTransforms.ColorTransform createMaximumChannelTransform()
      Create a ColorTransform that calculates the maximum of all channels.
      Returns:
    • createMinimumChannelTransform

      public static ColorTransforms.ColorTransform createMinimumChannelTransform()
      Create a ColorTransform that calculates the minimum of all channels.
      Returns: