PolyMode

class glue.viewers.common.qt.mouse_mode.PolyMode(viewer, **kwargs)[source]

Bases: glue.viewers.common.qt.mouse_mode.ClickRoiMode

Defines a Polygonal ROI, accessible via the roi() method

Attributes Summary

action_text
enabled A property that callback functions can be added to.
icon
persistent
shortcut
status_tip
tool_id
tool_tip

Methods Summary

activate()
clear()
close()
deactivate() Fired when the toolbar button is deactivated
key(event)
menu_actions() List of QtWidgets.QActions to be attached to this tool as a context menu.
move(event)
press(event)
release(event)
roi() The ROI defined by this mouse mode

Attributes Documentation

action_text = 'Polygonal ROI'
enabled

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:

default

The initial value for the property

docstring : str

The docstring for the property

getter, setter : func

Custom getter and setter functions (advanced)

icon = 'glue_lasso'
persistent = False
shortcut = 'G'
status_tip = 'CLICK and DRAG to define lasso, CLICK multiple times to define polygon, ENTER to finalize, ESCAPE to cancel'
tool_id = 'select:polygon'
tool_tip = 'Lasso a region of interest\n ENTER accepts the path\n ESCAPE clears the path'

Methods Documentation

activate()
clear()
close()
deactivate()

Fired when the toolbar button is deactivated

key(event)
menu_actions()

List of QtWidgets.QActions to be attached to this tool as a context menu.

move(event)
press(event)
release(event)
roi()

The ROI defined by this mouse mode

Returns:roi : Roi