Coder Social home page Coder Social logo

napari-power-widgets's Introduction

napari-power-widgets

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.

Examples

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.

@magicgui
def f(box: BoxSelection):
    print(box)
viewer.window.add_dock_widget(f)

2. OneOfRectangles

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

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

@magicgui
def f(rect: OneOfRectangles):
    print(rect)
viewer.window.add_dock_widget(f)

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.

@magicgui
def f(line: LineData):
    print(line)
viewer.window.add_dock_widget(f)

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.

@magicgui
def f(label: OneOfLabels):
    pass
viewer.window.add_dock_widget(f)

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.

@magicgui
def f(zrange: ZRange):
    print(zrange)
viewer.window.add_dock_widget(f)


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

Installation

You can install napari-power-widgets via pip:

pip install napari-power-widgets

To install latest development version :

pip install git+https://github.com/hanjinliu/napari-power-widgets.git

Contributing

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.

License

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

Issues

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

napari-power-widgets's People

Contributors

hanjinliu avatar

Stargazers

Xhark avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.