How to use the napari.layers.shapes.shapes.Shapes.bind_key function in napari

To help you get started, we’ve selected a few napari examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('Control-V')
def paste(layer):
    """Paste any copied shapes."""
    if layer._mode in (Mode.DIRECT, Mode.SELECT):
        layer._paste_data()
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('X')
def activate_vertex_remove_mode(layer):
    """Activate vertex deletion tool."""
    layer.mode = Mode.VERTEX_REMOVE
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('Escape')
def finish_drawing(layer):
    """Finish any drawing, for example when using the path or polygon tool."""
    layer._finish_drawing()
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('I')
def activate_vertex_insert_mode(layer):
    """Activate vertex insertion tool."""
    layer.mode = Mode.VERTEX_INSERT
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('E')
def activate_add_ellipse_mode(layer):
    """Activate add ellipse tool."""
    layer.mode = Mode.ADD_ELLIPSE
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('Z')
def activate_pan_zoom_mode(layer):
    """Activate pan and zoom mode."""
    layer.mode = Mode.PAN_ZOOM
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('Backspace')
def delete_selected(layer):
    """Delete any selected shapes."""
    layer.remove_selected()
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('S')
def activate_select_mode(layer):
    """Activate shape selection tool."""
    layer.mode = Mode.SELECT
github napari / napari / napari / layers / shapes / keybindings.py View on Github external
@Shapes.bind_key('P')
def activate_add_polygon_mode(layer):
    """Activate add polygon tool."""
    layer.mode = Mode.ADD_POLYGON