skimage.viewer.plugins.CannyPlugin (*args, …) | Canny filter plugin to show edges of an image. |
skimage.viewer.plugins.ColorHistogram ([max_pct]) | |
skimage.viewer.plugins.Crop ([maxdist]) | |
skimage.viewer.plugins.LabelPainter ([max_radius]) | |
skimage.viewer.plugins.LineProfile ([…]) | Plugin to compute interpolated intensity under a scan line on an image. |
skimage.viewer.plugins.Measure ([maxdist]) | |
skimage.viewer.plugins.OverlayPlugin (**kwargs) | Plugin for ImageViewer that displays an overlay on top of main image. |
skimage.viewer.plugins.PlotPlugin ([…]) | Plugin for ImageViewer that contains a plot canvas. |
skimage.viewer.plugins.Plugin ([…]) | Base class for plugins that interact with an ImageViewer. |
skimage.viewer.plugins.base | Base class for Plugins that interact with ImageViewer. |
skimage.viewer.plugins.canny | |
skimage.viewer.plugins.color_histogram | |
skimage.viewer.plugins.crop | |
skimage.viewer.plugins.labelplugin | |
skimage.viewer.plugins.lineprofile | |
skimage.viewer.plugins.measure | |
skimage.viewer.plugins.overlayplugin | |
skimage.viewer.plugins.plotplugin |
class skimage.viewer.plugins.CannyPlugin(*args, **kwargs)
[source]
Bases: skimage.viewer.plugins.overlayplugin.OverlayPlugin
Canny filter plugin to show edges of an image.
__init__(*args, **kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
name = 'Canny Filter'
class skimage.viewer.plugins.ColorHistogram(max_pct=0.99, **kwargs)
[source]
Bases: skimage.viewer.plugins.plotplugin.PlotPlugin
__init__(max_pct=0.99, **kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
ab_selected(extents)
[source]
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
help()
[source]
name = 'Color Histogram'
output()
[source]
Return the image mask and the histogram data.
Returns: |
|
---|
class skimage.viewer.plugins.Crop(maxdist=10, **kwargs)
[source]
Bases: skimage.viewer.plugins.base.Plugin
__init__(maxdist=10, **kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
crop(extents)
[source]
help()
[source]
name = 'Crop'
reset()
[source]
class skimage.viewer.plugins.LabelPainter(max_radius=20, **kwargs)
[source]
Bases: skimage.viewer.plugins.base.Plugin
__init__(max_radius=20, **kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
help()
[source]
label
name = 'LabelPainter'
on_enter(overlay)
[source]
radius
class skimage.viewer.plugins.LineProfile(maxdist=10, epsilon='deprecated', limits='image', **kwargs)
[source]
Bases: skimage.viewer.plugins.plotplugin.PlotPlugin
Plugin to compute interpolated intensity under a scan line on an image.
See PlotPlugin and Plugin classes for additional details.
Parameters: |
|
---|
__init__(maxdist=10, epsilon='deprecated', limits='image', **kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
get_profiles()
[source]
Return intensity profile of the selected line.
Returns: |
|
---|
help()
[source]
line_changed(end_points)
[source]
name = 'Line Profile'
output()
[source]
Return the drawn line and the resulting scan.
Returns: |
|
---|
reset_axes(scan_data)
[source]
class skimage.viewer.plugins.Measure(maxdist=10, **kwargs)
[source]
Bases: skimage.viewer.plugins.base.Plugin
__init__(maxdist=10, **kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
help()
[source]
line_changed(end_points)
[source]
name = 'Measure'
class skimage.viewer.plugins.OverlayPlugin(**kwargs)
[source]
Bases: skimage.viewer.plugins.base.Plugin
Plugin for ImageViewer that displays an overlay on top of main image.
The base Plugin class displays the filtered image directly on the viewer. OverlayPlugin will instead overlay an image with a transparent colormap.
See base Plugin class for additional details.
Attributes: |
|
---|
__init__(**kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
closeEvent(event)
[source]
On close disconnect all artists and events from ImageViewer.
Note that artists must be appended to self.artists
.
color
colors = {'cyan': (0, 1, 1), 'green': (0, 1, 0), 'red': (1, 0, 0), 'yellow': (1, 1, 0)}
display_filtered_image(image)
[source]
Display filtered image as an overlay on top of image in viewer.
filtered_image
Return filtered image.
This “filtered image” is used when saving from the plugin.
output()
[source]
Return the overlaid image.
Returns: |
|
---|
overlay
class skimage.viewer.plugins.PlotPlugin(image_filter=None, height=150, width=400, **kwargs)
[source]
Bases: skimage.viewer.plugins.base.Plugin
Plugin for ImageViewer that contains a plot canvas.
Base class for plugins that contain a Matplotlib plot canvas, which can, for example, display an image histogram.
See base Plugin class for additional details.
__init__(image_filter=None, height=150, width=400, **kwargs)
[source]
Initialize self. See help(type(self)) for accurate signature.
add_plot()
[source]
add_tool(tool)
[source]
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
redraw()
[source]
Redraw plot.
remove_tool(tool)
[source]
class skimage.viewer.plugins.Plugin(image_filter=None, height=0, width=400, useblit=True, dock='bottom')
[source]
Bases: PyQt5.QtWidgets.QDialog
Base class for plugins that interact with an ImageViewer.
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: |
|
---|
>>> from skimage.viewer import ImageViewer >>> from skimage.viewer.widgets import Slider >>> from skimage import data >>> >>> plugin = Plugin(image_filter=lambda img, ... threshold: img > threshold) # doctest: +SKIP >>> plugin += Slider('threshold', 0, 255) # doctest: +SKIP >>> >>> 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 image_filter
based on its parameter type, i.e., 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.
ptype = ‘kwarg’
is the default for most widgets so it’s unnecessary here.
Attributes: |
|
---|
__init__(image_filter=None, height=0, width=400, useblit=True, dock='bottom')
[source]
Initialize self. See help(type(self)) for accurate signature.
add_widget(widget)
[source]
Add widget to plugin.
Alternatively, Plugin’s __add__
method is overloaded to add widgets:
plugin += Widget(...)
Widgets can adjust required or optional arguments of filter function or parameters for the plugin. This is specified by the Widget’s ptype
.
attach(image_viewer)
[source]
Attach the plugin to an ImageViewer.
Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example:
viewer += Plugin(...)
Also note that attach
automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
clean_up()
[source]
closeEvent(event)
[source]
On close disconnect all artists and events from ImageViewer.
Note that artists must be appended to self.artists
.
display_filtered_image(image)
[source]
Display the filtered image on image viewer.
If you don’t want to simply replace the displayed image with the filtered image (e.g., you want to display a transparent overlay), you can override this method.
filter_image(*widget_arg)
[source]
Call image_filter
with widget args and kwargs
Note: display_filtered_image
is automatically called.
filtered_image
Return filtered image.
image_changed
image_viewer = 'Plugin is not attached to ImageViewer'
name = 'Plugin'
output()
[source]
Return the plugin’s representation and data.
Returns: |
|
---|
Derived classes should override this method to return a tuple containing an overlay of the same shape of the image, and a data object. Either of these is optional: return None
if you don’t want to return a value.
remove_image_artists()
[source]
Remove artists that are connected to the image viewer.
show(main_window=True)
[source]
Show plugin.
update_plugin(name, value)
[source]
Update keyword parameters of the plugin itself.
These parameters will typically be implemented as class properties so that they update the image or some other component.
© 2011 the scikit-image team
Licensed under the BSD 3-clause License.
http://scikit-image.org/docs/0.14.x/api/skimage.viewer.plugins.html