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. |
|
|
|
|
|
BaseWidget
¶
CheckBox
¶
- class skimage.viewer.widgets.CheckBox(name, value=False, alignment='center', ptype='kwarg', callback=None)[source]¶
Bases:
BaseWidget
CheckBox widget
- Parameters
- namestr
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
- callbackcallable 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.
- property val¶
ComboBox
¶
- class skimage.viewer.widgets.ComboBox(name, items, ptype='kwarg', callback=None)[source]¶
Bases:
BaseWidget
ComboBox widget for selecting among a list of choices.
- Parameters
- namestr
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.
- callbackcallable 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.
- property index¶
- property val¶
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:
BaseWidget
Slider widget for adjusting numeric parameters.
- Parameters
- namestr
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, highfloat
Range of slider values.
- valuefloat
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.
- callbackcallable 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]¶
- property val¶