Module: viewer.viewers
¶
Viewer for displaying image collections. |
|
|
Viewer for displaying images. |
|
ImageViewer class for viewing and interacting with images. |
CollectionViewer
¶
-
class
skimage.viewer.viewers.
CollectionViewer
(image_collection, update_on='move', **kwargs)[source]¶ Bases:
skimage.viewer.viewers.core.ImageViewer
Viewer for displaying image collections.
Select the displayed frame of the image collection using the slider or with the following keyboard shortcuts:
- left/right arrows
Previous/next image in collection.
- number keys, 0–9
0% to 90% of collection. For example, “5” goes to the image in the middle (i.e. 50%) of the collection.
- home/end keys
First/last image in collection.
- Parameters
- image_collectionlist of images
List of images to be displayed.
- update_on{‘move’ | ‘release’}
Control whether image is updated on slide or release of the image slider. Using ‘on_release’ will give smoother behavior when displaying large images or when writing a plugin/subclass that requires heavy computation.
ImageViewer
¶
-
class
skimage.viewer.viewers.
ImageViewer
(image, useblit=True)[source]¶ Bases:
PyQt5.QtWidgets.QMainWindow
Viewer for displaying images.
This viewer is a simple container object that holds a Matplotlib axes for showing images.
ImageViewer
doesn’t subclass the Matplotlib axes (or figure) because of the high probability of name collisions.Subclasses and plugins will likely extend the
update_image
method to add custom overlays or filter the displayed image.- Parameters
- imagearray
Image being viewed.
Examples
>>> from skimage import data >>> image = data.coins() >>> viewer = ImageViewer(image) >>> viewer.show()
- Attributes
- canvas, fig, axMatplotlib canvas, figure, and axes
Matplotlib canvas, figure, and axes used to display image.
- imagearray
Image being viewed. Setting this value will update the displayed frame.
- original_imagearray
Plugins typically operate on (but don’t change) the original image.
- pluginslist
List of attached plugins.
-
__init__
(self, image, useblit=True)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
connect_event
(self, event, callback)[source]¶ Connect callback function to matplotlib event and return id.
-
disconnect_event
(self, callback_id)[source]¶ Disconnect callback by its id (returned by
connect_event
).
-
dock_areas
= {'bottom': 8, 'left': 1, 'right': 2, 'top': 4}¶
-
property
image
¶
-
original_image_changed
¶
-
save_to_file
(self, filename=None)[source]¶ Save current image to file.
The current behavior is not ideal: It saves the image displayed on screen, so all images will be converted to RGB, and the image size is not preserved (resizing the viewer window will alter the size of the saved image).
-
show
(self, main_window=True)[source]¶ Show ImageViewer and attached plugins.
This behaves much like
matplotlib.pyplot.show
and QWidget.show.