Package qupath.lib.gui.panes
Class SimpleImageViewer
java.lang.Object
qupath.lib.gui.panes.SimpleImageViewer
A simple viewer for a single image, with options to save or copy.
This is primarily intended for RGB images, but can also be used for other types after applying automatic brightness/contrast settings.
This stores (and can be updated with) a BufferedImage
or a JavaFX Image
,
because both serve different purposes can be useful in different contexts.
- Since:
- v0.5.0
-
Property Summary
TypePropertyDescriptionGet a read-only property representing the buffered image.Get the property indicating whether the image should grow to fill the window (while maintaining its aspect ratio).Get a read-only property indicating the name of the image.Get a read-only property representing the JavaFX image.Get the placeholder text to show if no image is available.Get the percentage of any non-8-bit image that should be saturated when applying auto contrast settings. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet a read-only property representing the buffered image.Get the property indicating whether the image should grow to fill the window (while maintaining its aspect ratio).Get the buffered image.boolean
Query whether the image is allowed to expand beyond its preferred width and height to fill the window.getImage()
Get the JavaFX image.getName()
Get the name of the image.Get the placeholder text to show if no image is available.double
Get the percentage of pixels to use when applying auto contrast settings to a non-8-bit image.getStage()
Get the stage used to display the image.Get a read-only property indicating the name of the image.Get a read-only property representing the JavaFX image.Get the placeholder text to show if no image is available.void
Remove the image.Get the percentage of any non-8-bit image that should be saturated when applying auto contrast settings.void
setExpandToWindow
(boolean limit) Control whether the image should be allowed to expand beyond its preferred width and height to fill the window.void
setPlaceholderText
(String placeholder) Set the placeholder text to show if no image is available.void
setSaturationPercent
(double percent) Set the percentage of pixels to use when applying auto contrast settings to a non-8-bit image.void
updateImage
(String name, BufferedImage img) Update the image using a buffered image.void
updateImage
(String name, Image image) Update the image using a JavaFX image.
-
Property Details
-
placeholderText
Get the placeholder text to show if no image is available.- See Also:
-
saturationPercent
Get the percentage of any non-8-bit image that should be saturated when applying auto contrast settings.- See Also:
-
expandToWindow
Get the property indicating whether the image should grow to fill the window (while maintaining its aspect ratio). If false, the image will grow no larger than its preferred width and height.- See Also:
-
imageName
Get a read-only property indicating the name of the image.- See Also:
-
image
Get a read-only property representing the JavaFX image.- See Also:
-
bufferedImage
Get a read-only property representing the buffered image.- See Also:
-
-
Constructor Details
-
SimpleImageViewer
public SimpleImageViewer()Create a new simple image viewer. The stage will be created, but not shown.
-
-
Method Details
-
getPlaceholderText
Get the placeholder text to show if no image is available.- Returns:
-
setPlaceholderText
Set the placeholder text to show if no image is available.- Parameters:
placeholder
-
-
placeholderTextProperty
Get the placeholder text to show if no image is available.- Returns:
- See Also:
-
saturationPercentProperty
Get the percentage of any non-8-bit image that should be saturated when applying auto contrast settings.- Returns:
- See Also:
-
getSaturationPercent
public double getSaturationPercent()Get the percentage of pixels to use when applying auto contrast settings to a non-8-bit image.- Returns:
-
setSaturationPercent
public void setSaturationPercent(double percent) Set the percentage of pixels to use when applying auto contrast settings to a non-8-bit image.- Parameters:
percent
-
-
expandToWindowProperty
Get the property indicating whether the image should grow to fill the window (while maintaining its aspect ratio). If false, the image will grow no larger than its preferred width and height.- Returns:
- See Also:
-
getExpandToWindow
public boolean getExpandToWindow()Query whether the image is allowed to expand beyond its preferred width and height to fill the window. If false, the image will grow no larger than its preferred width and height.- Returns:
-
setExpandToWindow
public void setExpandToWindow(boolean limit) Control whether the image should be allowed to expand beyond its preferred width and height to fill the window. If false, the image will grow no larger than its preferred width and height.- Parameters:
limit
-
-
getStage
Get the stage used to display the image.- Returns:
-
updateImage
Update the image using a JavaFX image.- Parameters:
name
-image
-
-
resetImage
public void resetImage()Remove the image. -
updateImage
Update the image using a buffered image.- Parameters:
name
-img
-
-
imageNameProperty
Get a read-only property indicating the name of the image.- Returns:
-
getName
Get the name of the image.- Returns:
-
imageProperty
Get a read-only property representing the JavaFX image.- Returns:
- See Also:
-
getImage
Get the JavaFX image.- Returns:
-
bufferedImageProperty
Get a read-only property representing the buffered image.- Returns:
- See Also:
-
getBufferedImage
Get the buffered image.- Returns:
-