skimage 0.17.2

AttributesParameters

Attributes

image_viewer : ImageViewer

Window containing image used in measurement.

name : str

Name of plugin. This is displayed as the window title.

artist : list

List of Matplotlib artists and canvastools. Any artists created by the plugin should be added to this list so that it gets cleaned up on close.

A plugin connects an image filter (or another function) to an image viewer. Note that a Plugin is initialized without an image viewer and attached in a later step. See example below for details.

Parameters

image_viewer : ImageViewer

Window containing image used in measurement/manipulation.

image_filter : function

Function that gets called to update image in image viewer. This value can be :None:None:`None` if, for example, you have a plugin that extracts information from an image and doesn't manipulate it. Alternatively, this function can be defined as a method in a Plugin subclass.

height, width : int

Size of plugin window in pixels. Note that Qt will automatically resize a window to fit components. So if you're adding rows of components, you can leave :None:None:`height = 0` and just let Qt determine the final height.

useblit : bool

If True, use blitting to speed up animation. Only available on some Matplotlib backends. If None, set to True when using Agg backend. This only has an effect if you draw on top of an image viewer.

Base class for plugins that interact with an ImageViewer.

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage.viewer import ImageViewer
... from skimage.viewer.widgets import Slider
... from skimage import data >>>
This example is valid syntax, but we were not able to check execution
>>> plugin = Plugin(image_filter=lambda img,
...  threshold: img > threshold) # doctest: +SKIP
... plugin += Slider('threshold', 0, 255) # doctest: +SKIP >>>
This example is valid syntax, but we were not able to check execution
>>> image = data.coins()
... viewer = ImageViewer(image) # doctest: +SKIP
... viewer += plugin # doctest: +SKIP
... thresholded = viewer.show()[0][0] # doctest: +SKIP

The plugin will automatically delegate parameters to :None:None:`image_filter` based on its parameter type, i.e., :None:None:`ptype` (widgets for required arguments must be added in the order they appear in the function). The image attached to the viewer is automatically passed as the first argument to the filter function.

#TODO: Add flag so image is not passed to filter function by default.

:None:None:`ptype = 'kwarg'` is the default for most widgets so it's unnecessary here.

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/viewer/plugins/base.py#11
type: <class 'type'>
Commit: