Interface ChannelDisplayInfo
- All Known Subinterfaces:
- ChannelDisplayInfo.ModifiableChannelDisplayInfo,- SingleChannelDisplayInfo
- All Known Implementing Classes:
- AdditiveChannelInfo,- DirectServerChannelInfo
The primary uses are:
-  to extract floating point pixel values for the channel from a BufferedImage(either directly, or via some color transformation that may involve more than one channel/band from the BufferedImage)
- to generate RGB pixel values suitable for visualizing the raw channel values extracted above, including the storage of any lookup tables required
- to store min/max display values, which influence the lookup table mapping to RGB (i.e. to store brightness/contrast values)
- to update an existing RGB value, to facilitate creating composite images that depict the values of multiple channels in a single, merged visualization
 As such, its uses lie somewhere between Java's SampleModel and ColorModel classes.
 
Its reason for existing is that sometimes we need to be able to adjust the display of channels individually and to create merges - particularly in the case of fluorescence images - but to simplify whole slide image support we need to be able to do this on-the-fly. Switching the ColorModel for an existing BufferedImage is somewhat awkward, and when caching image tiles we want to be able to keep the original ColorModels intact - otherwise ColorModels for recently-seen tiles might be different from the ColorModels of tiles that have been in the cache for longer, even though they were read from the same image servers. Furthermore, 'unknown' image types (i.e. not standard RGB/BGR/single-channel images) don't always behave nicely with Graphics objects if we want to paint or scale them.
 Using the ChannelDisplayInfo approach means that during repainting an (A)RGB image can be produced on-the-fly
 without needing to create a new image with the desired ColorModel for painting.
 This potentially ends up requiring a bit more computation that is really necessary - and it may be optimized
 better in the future - but it was the simplest method I could come up with to provide the features I wanted...
 
 Before v0.4.0, some methods supported a boolean parameter to specify whether or not to use color LUTs.
 Since v0.4.0, this has been replaced by ChannelDisplayMode to support different ways of visualizing channels.
 In particular, in some cases an inverted display is requested - where 'inverted' refers to the background 
 (i.e. switching from black is zero to white is zero, or vice versa depending upon the default display). 
 Because only additive combinations of RGB colors are permitted, requesting inversion means that the color used for the 
 LUT should be inverted but everything else proceeds are normal. 
 The calling code then has the job of inverting the resulting image, as done by 
 ImageDisplay.applyTransforms(BufferedImage, BufferedImage, java.util.List, ChannelDisplayMode).
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceHelper interface to indicate that the display ranges can be modified.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true if this does something - anything - and false otherwise.getColor()Predominate color used when this ChannelDisplayInfo uses a Color LUT (e.g.floatGet the max allowed display value.floatGet the max display value.Get theColorTransformer.ColorTransformMethodassociated with this channel, or null if no method is relevant.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.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 one
- 
Method Details- 
getNameString getName()Get the channel name. This may also be returned by thetoString()method.- Returns:
 
- 
getMinDisplayfloat getMinDisplay()Get the min display value. This is used to control the brightness/contrast when painting.- Returns:
 
- 
getMaxDisplayfloat getMaxDisplay()Get the max display value. This is used to control the brightness/contrast when painting.- Returns:
 
- 
getMinAllowedfloat getMinAllowed()Get the min allowed display value. This is only a hint.- Returns:
 
- 
getMaxAllowedfloat getMaxAllowed()Get the max allowed display value. This is only a hint.- Returns:
 
- 
isAdditiveboolean isAdditive()Returns 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:
 
- 
isBrightnessContrastRescaledboolean isBrightnessContrastRescaled()Returns true if rescaling according to min & max display levels is applied, false if the full display range is used.- Returns:
 
- 
getValueAsStringGet 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:
 
- 
getRGBGet the RGB value that would be used to display a particular pixel- Parameters:
- img-
- x-
- y-
- mode-
- Returns:
 
- 
getRGBGet the RGB values that would be used to display all the pixels of an image- Parameters:
- img-
- rgb-
- mode-
- Returns:
 
- 
updateRGBAdditiveUpdate an existing pixel (packed RGB) additively using the color used to display a specified one- Parameters:
- img-
- x-
- y-
- rgb-
- mode-
- Returns:
 
- 
updateRGBAdditiveUpdate 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-
 
- 
doesSomethingboolean doesSomething()Returns 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:
 
- 
getColorInteger getColor()Predominate 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:
 
- 
getMethodGet theColorTransformer.ColorTransformMethodassociated with this channel, or null if no method is relevant.- Returns:
 
 
-