Skip to main content

A pocket calculator like interface to image processing in napari

Project description

napari-assistant

License PyPI Python Version tests codecov Development Status napari hub DOI

The napari-assistant is a napari meta-plugin for building image processing workflows.

Usage

After installing one or more napari plugins that use the napari-assistant as user interface, you can start it from the menu Tools > Utilities > Assistant (na) or run naparia from the command line. By clicking on the buttons in the assistant, you can setup a workflow for processing the images.

img.png

While setting up your workflow, you can at any point select a layer from the layer list (1) and change the parameters of the corresponding operation (2). The layer will update when you change parameters and also all subsequent operations. You can also vary which operation is applied to the image (3). Also make sure the right input image layer is selected (4).

img.png

Saving and loading workflows

You can also save and load workflows to disk.

img.png

After loading a workflow, make sure that the right input images are selected.

Code generation

The napari-assistant allows exporting the given workflow as Python script and Jupyter Notebook.

img.png

Furthermore, if you have the napari-script-editor installed, you can also send the current workflow as code to the script editor from the same menu.

img.png

Installation

It is recommended to install the napari-assistant via one of the plugins that use it as graphical user interface. You find a complete list of plugins that use the assistant on the napari-hub.

For developers

If you want to make your napari-plugin accessible from the napari-assistant, consider programming functions with a simple interface that consume images, labels, integers, floats and strings. Annotate input and return types, e.g. like this:

def example_function_widget(image: "napari.types.ImageData") -> "napari.types.LabelsData":
    from skimage.filters import threshold_otsu
    binary_image = image > threshold_otsu(image)

    from skimage.measure import label
    return label(binary_image)

Furthermore, please add your function to the napari.yaml which uses npe2:

name: napari-npe2-test
display_name: napari-npe2-test
contributions:
  commands: 
    - id: napari-npe2-test.make_magic_widget
      python_name: napari_npe2_test._widget:example_magic_widget
      title: Make example magic widget
  widgets:
    - command: napari-npe2-test.make_magic_widget
      display_name: Segmentation / labeling > Otsu Labeling (nnpe2t)

To put it in the right button within the napari-assistant, please use one of the following prefixes for the display_name:

  • Filtering / noise removal >
  • Filtering / background removal >
  • Filtering >
  • Image math >
  • Transform >
  • Projection >
  • Segmentation / binarization >
  • Segmentation / labeling >
  • Segmentation post-processing >
  • Measurement >
  • Label neighbor filters >
  • Label filters >
  • Visualization >

You find a fully functional example here.

Last but not least, to make your napari-plugin is listed in the napari-hub when searching for "napari-assistant", make sure you mention it in your readme.

Feedback welcome!

The napari-assistant is developed in the open because we believe in the open source community. Feel free to drop feedback as github issue or via image.sc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari-assistant-0.1.10.tar.gz (271.4 kB view details)

Uploaded Source

Built Distribution

napari_assistant-0.1.10-py3-none-any.whl (296.3 kB view details)

Uploaded Python 3

File details

Details for the file napari-assistant-0.1.10.tar.gz.

File metadata

  • Download URL: napari-assistant-0.1.10.tar.gz
  • Upload date:
  • Size: 271.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.6.4 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for napari-assistant-0.1.10.tar.gz
Algorithm Hash digest
SHA256 8133afb340418da4e7201eb3abb81a29abde05503755cd71288a6fae3504c564
MD5 6d76fc2e7ffe68bb05ed6d601035c0ce
BLAKE2b-256 d1e5a1e2f81c5abbb77a0f73cf1aa0abf84d94b52af6558f452c0e53be3aa09c

See more details on using hashes here.

File details

Details for the file napari_assistant-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: napari_assistant-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 296.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.6.4 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for napari_assistant-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 24b4e037956287db8d6f47ba0c0acedfd9b5f9365dca1b01be4c318bf0be3fc8
MD5 9e7fa2fab04265cb0502a8fd55b37ea3
BLAKE2b-256 ccec888c12490d4040c9834196483ff17b64437a85029b6e1e8ab6eac5c2abbc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page