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 SummaryPropertiesTypePropertyDescriptionGet 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 SummaryConstructors
- 
Method SummaryModifier 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.booleanQuery 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.doubleGet 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.voidRemove the image.Get the percentage of any non-8-bit image that should be saturated when applying auto contrast settings.voidsetExpandToWindow(boolean limit) Control whether the image should be allowed to expand beyond its preferred width and height to fill the window.voidsetPlaceholderText(String placeholder) Set the placeholder text to show if no image is available.voidsetSaturationPercent(double percent) Set the percentage of pixels to use when applying auto contrast settings to a non-8-bit image.voidupdateImage(String name, BufferedImage img) Update the image using a buffered image.voidupdateImage(String name, Image image) Update the image using a JavaFX image.
- 
Property Details- 
placeholderTextGet the placeholder text to show if no image is available.- See Also:
 
- 
saturationPercentGet the percentage of any non-8-bit image that should be saturated when applying auto contrast settings.- See Also:
 
- 
expandToWindowGet 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:
 
- 
imageNameGet a read-only property indicating the name of the image.- See Also:
 
- 
imageGet a read-only property representing the JavaFX image.- See Also:
 
- 
bufferedImageGet a read-only property representing the buffered image.- See Also:
 
 
- 
- 
Constructor Details- 
SimpleImageViewerpublic SimpleImageViewer()Create a new simple image viewer. The stage will be created, but not shown.
 
- 
- 
Method Details- 
getPlaceholderTextGet the placeholder text to show if no image is available.- Returns:
 
- 
setPlaceholderTextSet the placeholder text to show if no image is available.- Parameters:
- placeholder-
 
- 
placeholderTextPropertyGet the placeholder text to show if no image is available.- Returns:
- See Also:
 
- 
saturationPercentPropertyGet the percentage of any non-8-bit image that should be saturated when applying auto contrast settings.- Returns:
- See Also:
 
- 
getSaturationPercentpublic double getSaturationPercent()Get the percentage of pixels to use when applying auto contrast settings to a non-8-bit image.- Returns:
 
- 
setSaturationPercentpublic void setSaturationPercent(double percent) Set the percentage of pixels to use when applying auto contrast settings to a non-8-bit image.- Parameters:
- percent-
- Implementation Note
- this will unbind the property from PathPrefs.autoBrightnessContrastSaturationPercentProperty()
 
- 
expandToWindowPropertyGet 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:
 
- 
getExpandToWindowpublic 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:
 
- 
setExpandToWindowpublic 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-
 
- 
getStageGet the stage used to display the image.- Returns:
 
- 
updateImageUpdate the image using a JavaFX image.- Parameters:
- name-
- image-
 
- 
resetImagepublic void resetImage()Remove the image.
- 
updateImageUpdate the image using a buffered image.- Parameters:
- name-
- img-
 
- 
imageNamePropertyGet a read-only property indicating the name of the image.- Returns:
 
- 
getNameGet the name of the image.- Returns:
 
- 
imagePropertyGet a read-only property representing the JavaFX image.- Returns:
- See Also:
 
- 
getImageGet the JavaFX image.- Returns:
 
- 
bufferedImagePropertyGet a read-only property representing the buffered image.- Returns:
- See Also:
 
- 
getBufferedImageGet the buffered image.- Returns:
 
 
-