Powerful widgets and type annotations for napari plugin widgets

    View project data

    License BSD-3 PyPI Python Version tests codecov napari hub

    Powerful magicgui widgets and type annotations for general-purpose napari plugin development.

    napari-power-widgets makes the full use of type-to-widget mapping strategy of magicgui to provide napari-specific types and value-widgets, which will be very useful to improve UI/UX of your napari plugins with simple codes.

    Currently, napari-power-widgets does not provide any reader, writer or widget. It is supposed to be used programmatically.


    Some types/widgets and the possible usage are picked up here (→ check all). If you have any neat ideas, please open an issue.

    1. BoxSelection

    Alias of a four-float tuple for 2D selection. You can set the value by drawing a interaction box in the viewer.

    e. g. : image cropper, rectangular labeling etc.

    def f(box: BoxSelection):

    2. OneOfRectangles

    Alias of np.ndarray for one of rectangles in a Shapes layer.

    e. g. : image cropper, rectangular labeling etc.

    def f(rect: OneOfRectangles):

    3. LineData

    Alias of np.ndarray for a line data. You can obtain the data by manually drawing a line in the viewer.

    e. g. : line profiling, kymograph etc.

    def f(line: LineData):

    4. OneOfLabels

    Alias of boolean np.ndarray for a labeled region. You can choose ones by directly clicking the viewer.

    e. g. : image masking, feature measurement etc.

    def f(label: OneOfLabels):

    5. ZRange

    Alias of a tuple of float that represents the limit of the third dimension. You can select the values by moving the dimension slider.

    e. g. : movie trimming, partial image projection etc.

    def f(zrange: ZRange):

    This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.


    You can install napari-power-widgets via pip:

    pip install napari-power-widgets

    To install latest development version :

    pip install git+


    Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.


    Distributed under the terms of the BSD-3 license, "napari-power-widgets" is free and open source software


    If you encounter any problems, please file an issue along with a detailed description.


    • 0.0.1

    Release date:

    • 11 November 2022

    First released:

    • 11 November 2022


    • BSD-3-Clause

    Supported data:

    • Information not submitted

    Plugin type:

    • Information not submitted

    GitHub activity:

    • Stars: 1
    • Forks: 0
    • Issues + PRs: 0

    Python versions supported:

    Operating system:


    • numpy
    • pandas
    • typing-extensions
    • magicgui
    • napari

    Sign up to receive updates