Package qupath.lib.images.servers
Class ImageChannel
java.lang.Object
qupath.lib.images.servers.ImageChannel
The name and display color for a single image channel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImageChannelDefault blue channel for RGB images.static final ImageChannelDefault green channel for RGB images.static final ImageChannelDefault red channel for RGB images.static final IntegerSpecial color indicating pixel values for a channel indicate levels of transparency. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic List<ImageChannel> getChannelList(String... names) Convert an array of channel names into a list ofImageChannelusing default colors.getColor()Color used to display the output channelstatic IntegergetDefaultChannelColor(int channel) Get the default color for a specified channel, for use when no channel colors are already known.static List<ImageChannel> getDefaultChannelList(int nChannels) Get default channel list for an image with a specified number of channels.static List<ImageChannel> Get default channel list for RGB images.static ImageChannelgetInstance(String name, Integer color) Get a channel instance with the specified name and color.getName()Name of the output channel.inthashCode()booleanCheck if the color is 'transparent'; this is used for background/ignored channels.toString()
-
Field Details
-
TRANSPARENT
Special color indicating pixel values for a channel indicate levels of transparency. -
RED
Default red channel for RGB images. -
GREEN
Default green channel for RGB images. -
BLUE
Default blue channel for RGB images.
-
-
Method Details
-
getInstance
Get a channel instance with the specified name and color.- Parameters:
name- Name for the channel - this must not be null.color- Color as a packed (A)RGB value.- Returns:
-
getChannelList
Convert an array of channel names into a list ofImageChannelusing default colors.- Parameters:
names- the names of the channels- Returns:
- a list of
ImageChannel, where channel names are taken from the input array
-
toString
-
getDefaultChannelColor
Get the default color for a specified channel, for use when no channel colors are already known.Note that the exact colors returned may differ in future releases, and it is not guaranteed that all colors will be unique. If the colors must be exactly reproducible then it is better to specify them rather than to depend on this method.
- Parameters:
channel-- Returns:
-
getDefaultRGBChannels
Get default channel list for RGB images.- Returns:
-
getDefaultChannelList
Get default channel list for an image with a specified number of channels. This is useful whenever no further channel name or color information is available.- Parameters:
nChannels-- Returns:
-
isTransparent
public boolean isTransparent()Check if the color is 'transparent'; this is used for background/ignored channels.- Returns:
-
getName
Name of the output channel.- Returns:
-
getColor
Color used to display the output channel- Returns:
-
hashCode
public int hashCode() -
equals
-