Package qupath.lib.display
Class AdditiveChannelInfo
java.lang.Object
qupath.lib.display.AdditiveChannelInfo
- All Implemented Interfaces:
- ChannelDisplayInfo,- ChannelDisplayInfo.ModifiableChannelDisplayInfo
Class for combining channels additively, then providing controls on the resulting RGB image.
 
This was created to support the display of non-8-bit brightfield images in a similar way to RGB images.
- Since:
- v0.6.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface qupath.lib.display.ChannelDisplayInfoChannelDisplayInfo.ModifiableChannelDisplayInfo
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanprotected floatprotected floatprotected floatprotected float
- 
Constructor SummaryConstructorsConstructorDescriptionAdditiveChannelInfo(ImageData<BufferedImage> imageData, List<DirectServerChannelInfo> channels) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true if this does something - anything - and false otherwise.Get an unmodifiable list of the channels that are merged here for display.getColor()Predominate color used when this ChannelDisplayInfo uses a Color LUT (e.g.protected ImageData<BufferedImage> protected ImageServer<BufferedImage> floatGet the max allowed display value.floatGet the max display value.floatGet the min allowed display value.floatGet the min display value.getName()Get the channel name.int[]getRGB(BufferedImage img, int[] rgb, ChannelDisplayMode mode) Get the RGB values that would be used to display all the pixels of an imageintgetRGB(BufferedImage img, int x, int y, ChannelDisplayMode mode) Get the RGB value that would be used to display a particular pixelgetValueAsString(BufferedImage img, int x, int y) Get a string representation of a pixel's value.booleanReturns true if this channel can be used additively to create a composite image display; returns false if this channel wants all the color information to itself, so can't be displayed with others.booleanReturns true if rescaling according to min & max display levels is applied, false if the full display range is used.voidsetMaxDisplay(float maxDisplay) Set the max display value for this channel.voidsetMinDisplay(float minDisplay) Set the min display value for this channel.voidsetMinMaxAllowed(float minAllowed, float maxAllowed) Set the maximum permissible range for the image display.toString()voidupdateRGBAdditive(BufferedImage img, int[] rgb, ChannelDisplayMode mode) Update an array of existing pixels (packed RGB) additively using the colors to display a specified image.intupdateRGBAdditive(BufferedImage img, int x, int y, int rgb, ChannelDisplayMode mode) Update an existing pixel (packed RGB) additively using the color used to display a specified oneMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface qupath.lib.display.ChannelDisplayInfogetMethod
- 
Field Details- 
minAllowedprotected float minAllowed
- 
maxAllowedprotected float maxAllowed
- 
minDisplayprotected float minDisplay
- 
maxDisplayprotected float maxDisplay
- 
clipToAllowedprotected boolean clipToAllowed
 
- 
- 
Constructor Details- 
AdditiveChannelInfopublic AdditiveChannelInfo(ImageData<BufferedImage> imageData, List<DirectServerChannelInfo> channels) 
 
- 
- 
Method Details- 
getNameDescription copied from interface:ChannelDisplayInfoGet the channel name. This may also be returned by thetoString()method.- Returns:
 
- 
getValueAsStringDescription copied from interface:ChannelDisplayInfoGet a string representation of a pixel's value. This might be a single number, or 3 numbers for an RGB image where the channel includes all values.- Parameters:
- img-
- x-
- y-
- Returns:
 
- 
getRGBDescription copied from interface:ChannelDisplayInfoGet the RGB value that would be used to display a particular pixel- Parameters:
- img-
- x-
- y-
- mode-
- Returns:
 
- 
getRGBDescription copied from interface:ChannelDisplayInfoGet the RGB values that would be used to display all the pixels of an image- Parameters:
- img-
- rgb-
- mode-
- Returns:
 
- 
updateRGBAdditiveDescription copied from interface:ChannelDisplayInfoUpdate an array of existing pixels (packed RGB) additively using the colors to display a specified image. May throw an UnsupportedOperationException if isAdditive() returns false;- Parameters:
- img-
- rgb-
- mode-
 
- 
doesSomethingpublic boolean doesSomething()Description copied from interface:ChannelDisplayInfoReturns true if this does something - anything - and false otherwise. For example, this will return false if we have an RGB image with no transformations of any kind applied (e.g. brightness/contrast)- Returns:
 
- 
isAdditivepublic boolean isAdditive()Description copied from interface:ChannelDisplayInfoReturns true if this channel can be used additively to create a composite image display; returns false if this channel wants all the color information to itself, so can't be displayed with others.- Returns:
 
- 
getColorDescription copied from interface:ChannelDisplayInfoPredominate color used when this ChannelDisplayInfo uses a Color LUT (e.g. Color.RED for a red channel). Returns null if there is no appropriate color choice, or the image is RGB.- Returns:
 
- 
getChannelsGet an unmodifiable list of the channels that are merged here for display.- Returns:
- a list of channels
 
- 
getImageData
- 
getImageServer
- 
setMinMaxAllowedpublic void setMinMaxAllowed(float minAllowed, float maxAllowed) Description copied from interface:ChannelDisplayInfo.ModifiableChannelDisplayInfoSet the maximum permissible range for the image display.For an 8-bit image, that should be 0 and 255. For a 16-bit image, fewer bits might actually be used... therefore the full range of 0-2^16-1 may be too much. Also, for a 32-bit floating point image the limits are rather harder to define in a general way. This method makes it possible to restrict the permissible range to something sensible. Brightness/contrast/min/max sliders may make use of this. - Specified by:
- setMinMaxAllowedin interface- ChannelDisplayInfo.ModifiableChannelDisplayInfo
- Parameters:
- minAllowed-
- maxAllowed-
 
- 
isBrightnessContrastRescaledpublic boolean isBrightnessContrastRescaled()Description copied from interface:ChannelDisplayInfoReturns true if rescaling according to min & max display levels is applied, false if the full display range is used.- Specified by:
- isBrightnessContrastRescaledin interface- ChannelDisplayInfo
- Returns:
 
- 
setMinDisplaypublic void setMinDisplay(float minDisplay) Description copied from interface:ChannelDisplayInfo.ModifiableChannelDisplayInfoSet the min display value for this channel. Note that it is *strongly* advised to useImageDisplay.setMinMaxDisplayinstead since this helps ensure that theImageDisplayfires appropriate events etc.- Specified by:
- setMinDisplayin interface- ChannelDisplayInfo.ModifiableChannelDisplayInfo
- Parameters:
- minDisplay-
- See Also:
 
- 
setMaxDisplaypublic void setMaxDisplay(float maxDisplay) Description copied from interface:ChannelDisplayInfo.ModifiableChannelDisplayInfoSet the max display value for this channel. Note that it is *strongly* advised to useImageDisplay.setMinMaxDisplayinstead since this helps ensure that theImageDisplayfires appropriate events etc.- Specified by:
- setMaxDisplayin interface- ChannelDisplayInfo.ModifiableChannelDisplayInfo
- Parameters:
- maxDisplay-
- See Also:
 
- 
getMinAllowedpublic float getMinAllowed()Description copied from interface:ChannelDisplayInfoGet the min allowed display value. This is only a hint.- Specified by:
- getMinAllowedin interface- ChannelDisplayInfo
- Returns:
 
- 
getMaxAllowedpublic float getMaxAllowed()Description copied from interface:ChannelDisplayInfoGet the max allowed display value. This is only a hint.- Specified by:
- getMaxAllowedin interface- ChannelDisplayInfo
- Returns:
 
- 
getMinDisplaypublic float getMinDisplay()Description copied from interface:ChannelDisplayInfoGet the min display value. This is used to control the brightness/contrast when painting.- Specified by:
- getMinDisplayin interface- ChannelDisplayInfo
- Returns:
 
- 
getMaxDisplaypublic float getMaxDisplay()Description copied from interface:ChannelDisplayInfoGet the max display value. This is used to control the brightness/contrast when painting.- Specified by:
- getMaxDisplayin interface- ChannelDisplayInfo
- Returns:
 
- 
updateRGBAdditiveDescription copied from interface:ChannelDisplayInfoUpdate an existing pixel (packed RGB) additively using the color used to display a specified one- Specified by:
- updateRGBAdditivein interface- ChannelDisplayInfo
- Parameters:
- img-
- x-
- y-
- rgb-
- mode-
- Returns:
 
- 
toString
 
-