Module: viewer.widgets
¶
Widgets for interacting with ImageViewer.
These widgets should be added to a Plugin subclass using its add_widget method or calling:
plugin += Widget(...)
on a Plugin instance. The Plugin will delegate action based on the widget’s parameter type specified by its ptype attribute, which can be:
'arg' : positional argument passed to Plugin's `filter_image` method.
'kwarg' : keyword argument passed to Plugin's `filter_image` method.
'plugin' : attribute of Plugin. You'll probably need to add a class
property of the same name that updates the display.
|
|
|
Button which calls callback upon click. |
|
CheckBox widget |
|
ComboBox widget for selecting among a list of choices. |
Buttons that close the parent plugin. |
|
|
Buttons to save image to io.stack or to a file. |
|
Slider widget for adjusting numeric parameters. |
|
|
|
|
|
Button
¶
CheckBox
¶
-
class
skimage.viewer.widgets.
CheckBox
(name, value=False, alignment='center', ptype='kwarg', callback=None)[source]¶ Bases:
skimage.viewer.widgets.core.BaseWidget
CheckBox widget
- Parameters
name : str
Name of CheckBox parameter. If this parameter is passed as a keyword argument, it must match the name of that keyword argument (spaces are replaced with underscores). In addition, this name is displayed as the name of the CheckBox.
value: {False, True}, optional
Initial state of the CheckBox.
alignment: {‘center’,’left’,’right’}, optional
Checkbox alignment
ptype : {‘arg’ | ‘kwarg’ | ‘plugin’}, optional
Parameter type
callback : callable f(widget_name, value), optional
Callback function called in response to checkbox changes. Note: This function is typically set (overridden) when the widget is added to a plugin.
-
__init__
(name, value=False, alignment='center', ptype='kwarg', callback=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
val
¶
ComboBox
¶
-
class
skimage.viewer.widgets.
ComboBox
(name, items, ptype='kwarg', callback=None)[source]¶ Bases:
skimage.viewer.widgets.core.BaseWidget
ComboBox widget for selecting among a list of choices.
- Parameters
name : str
Name of ComboBox parameter. If this parameter is passed as a keyword argument, it must match the name of that keyword argument (spaces are replaced with underscores). In addition, this name is displayed as the name of the ComboBox.
items: list of str
Allowed parameter values.
ptype : {‘arg’ | ‘kwarg’ | ‘plugin’}, optional
Parameter type.
callback : callable f(widget_name, value), optional
Callback function called in response to combobox changes. Note: This function is typically set (overridden) when the widget is added to a plugin.
-
__init__
(name, items, ptype='kwarg', callback=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
index
¶
-
property
val
¶
OKCancelButtons
¶
SaveButtons
¶
-
class
skimage.viewer.widgets.
SaveButtons
(name='Save to:', default_format='png')[source]¶ Bases:
skimage.viewer.widgets.core.BaseWidget
Buttons to save image to io.stack or to a file.
Slider
¶
-
class
skimage.viewer.widgets.
Slider
(name, low=0.0, high=1.0, value=None, value_type='float', ptype='kwarg', callback=None, max_edit_width=60, orientation='horizontal', update_on='release')[source]¶ Bases:
skimage.viewer.widgets.core.BaseWidget
Slider widget for adjusting numeric parameters.
- Parameters
name : str
Name of slider parameter. If this parameter is passed as a keyword argument, it must match the name of that keyword argument (spaces are replaced with underscores). In addition, this name is displayed as the name of the slider.
low, high : float
Range of slider values.
value : float
Default slider value. If None, use midpoint between low and high.
value_type : {‘float’ | ‘int’}, optional
Numeric type of slider value.
ptype : {‘kwarg’ | ‘arg’ | ‘plugin’}, optional
Parameter type.
callback : callable f(widget_name, value), optional
Callback function called in response to slider changes. Note: This function is typically set (overridden) when the widget is added to a plugin.
orientation : {‘horizontal’ | ‘vertical’}, optional
Slider orientation.
update_on : {‘release’ | ‘move’}, optional
Control when callback function is called: on slider move or release.
-
__init__
(name, low=0.0, high=1.0, value=None, value_type='float', ptype='kwarg', callback=None, max_edit_width=60, orientation='horizontal', update_on='release')[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
val
¶