napari-assistant


Namenapari-assistant JSON
Version 0.4.11 PyPI version JSON
download
home_pagehttps://github.com/haesleinhuepf/napari-assistant/
SummaryA pocket calculator like interface to image processing in napari
upload_time2024-12-06 06:53:09
maintainerNone
docs_urlNone
authorRobert Haase, Ryan Savill
requires_python>=3.8
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements napari-plugin-engine toolz napari magicgui numpy pyperclip loguru jupytext jupyter pandas napari-time-slicer napari-workflows
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # napari-assistant
[![License](https://img.shields.io/pypi/l/napari-assistant.svg?color=green)](https://github.com/haesleinhuepf/napari-assistant/raw/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-assistant.svg?color=green)](https://pypi.org/project/napari-assistant)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-assistant.svg?color=green)](https://python.org)
[![tests](https://github.com/haesleinhuepf/napari-assistant/workflows/tests/badge.svg)](https://github.com/haesleinhuepf/napari-assistant/actions)
[![codecov](https://codecov.io/gh/haesleinhuepf/napari-assistant/branch/master/graph/badge.svg)](https://codecov.io/gh/haesleinhuepf/napari-assistant)
[![Development Status](https://img.shields.io/pypi/status/napari-assistant.svg)](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-assistant)](https://napari-hub.org/plugins/napari-assistant)
[![DOI](https://zenodo.org/badge/463875112.svg)](https://zenodo.org/badge/latestdoi/463875112)


The napari-assistant is a [napari](https://github.com/napari/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](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/napari-assistant-screenshot.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](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/design_workflows.png)

### Saving and loading workflows

You can also save and load workflows to disk. 

![img.png](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/save_and_load.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](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/code_generator.png)

Furthermore, if you have the [napari-script-editor](https://www.napari-hub.org/plugins/napari-script-editor) installed,
you can also send the current workflow as code to the script editor from the same menu.

![img.png](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/napari_script_editor.png)

### Plugin generation

There is also a Napari plugin generator available. Check out [its documentation](https://github.com/haesleinhuepf/napari-assistant-plugin-generator) to learn how napari-assistant compatible plugins can be generated directly from within the assistant.

## 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](https://www.napari-hub.org/?search=napari-assistant&sort=relevance).
Multiple of these plugins come bundled when installing [devbio-napari](https://www.napari-hub.org/plugins/devbio-napari).

## 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:
```python
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](https://github.com/napari/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](https://github.com/haesleinhuepf/napari-npe2-test).

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](https://github.com/haesleinhuepf/napari-assistant/issues) or via [image.sc](https://image.sc)

## Contributing

Contributions are very welcome. Please ensure
the test coverage at least stays the same before you submit a pull request.

## License

Distributed under the terms of the [BSD-3] license,
"napari-assistant" is free and open source software

## Acknowledgements
This project was supported by the Deutsche Forschungsgemeinschaft under Germany’s Excellence Strategy – EXC2068 - Cluster of Excellence "Physics of Life" of TU Dresden. 
This project has been made possible in part by grant number [2021-240341 (Napari plugin accelerator grant)](https://chanzuckerberg.com/science/programs-resources/imaging/napari/improving-image-processing/) from the Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation.

[BSD-3]: http://opensource.org/licenses/BSD-3-Clause


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/haesleinhuepf/napari-assistant/",
    "name": "napari-assistant",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Robert Haase, Ryan Savill",
    "author_email": "robert.haase@tu-dresden.de",
    "download_url": "https://files.pythonhosted.org/packages/d7/a2/ad09e5200f6464cda021f5a8baff4359e5c06f4dd78619d98d7069c6a914/napari_assistant-0.4.11.tar.gz",
    "platform": null,
    "description": "# napari-assistant\n[![License](https://img.shields.io/pypi/l/napari-assistant.svg?color=green)](https://github.com/haesleinhuepf/napari-assistant/raw/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-assistant.svg?color=green)](https://pypi.org/project/napari-assistant)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-assistant.svg?color=green)](https://python.org)\n[![tests](https://github.com/haesleinhuepf/napari-assistant/workflows/tests/badge.svg)](https://github.com/haesleinhuepf/napari-assistant/actions)\n[![codecov](https://codecov.io/gh/haesleinhuepf/napari-assistant/branch/master/graph/badge.svg)](https://codecov.io/gh/haesleinhuepf/napari-assistant)\n[![Development Status](https://img.shields.io/pypi/status/napari-assistant.svg)](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-assistant)](https://napari-hub.org/plugins/napari-assistant)\n[![DOI](https://zenodo.org/badge/463875112.svg)](https://zenodo.org/badge/latestdoi/463875112)\n\n\nThe napari-assistant is a [napari](https://github.com/napari/napari) meta-plugin for building image processing workflows. \n\n## Usage\n\nAfter installing one or more napari plugins that use the napari-assistant as user interface, you can start it from the \nmenu `Tools > Utilities > Assistant (na)` or run `naparia` from the command line. \n\nBy clicking on the buttons in the assistant, you can setup a workflow for processing the images.\n\n![img.png](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/napari-assistant-screenshot.png)\n\nWhile setting up your workflow, you can at any point select a layer from the layer list (1) and change the parameters of\nthe corresponding operation (2). The layer will update when you change parameters and also all subsequent operations. \nYou can also vary which operation is applied to the image (3). Also make sure the right input image layer is selected (4).\n\n![img.png](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/design_workflows.png)\n\n### Saving and loading workflows\n\nYou can also save and load workflows to disk. \n\n![img.png](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/save_and_load.png)\n\nAfter loading a workflow, make sure that the right input images are selected.\n\n### Code generation\n\nThe napari-assistant allows exporting the given workflow as Python script and Jupyter Notebook. \n\n![img.png](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/code_generator.png)\n\nFurthermore, if you have the [napari-script-editor](https://www.napari-hub.org/plugins/napari-script-editor) installed,\nyou can also send the current workflow as code to the script editor from the same menu.\n\n![img.png](https://github.com/haesleinhuepf/napari-assistant/raw/main/docs/napari_script_editor.png)\n\n### Plugin generation\n\nThere is also a Napari plugin generator available. Check out [its documentation](https://github.com/haesleinhuepf/napari-assistant-plugin-generator) to learn how napari-assistant compatible plugins can be generated directly from within the assistant.\n\n## Installation\n\nIt is recommended to install the napari-assistant via one of the plugins that use it as graphical user interface.\nYou find a complete list of plugins that use the assistant [on the napari-hub](https://www.napari-hub.org/?search=napari-assistant&sort=relevance).\nMultiple of these plugins come bundled when installing [devbio-napari](https://www.napari-hub.org/plugins/devbio-napari).\n\n## For developers\n\nIf you want to make your napari-plugin accessible from the napari-assistant, consider programming functions with a simple \ninterface that consume images, labels, integers, floats and strings. Annotate input and return types, e.g. like this:\n```python\ndef example_function_widget(image: \"napari.types.ImageData\") -> \"napari.types.LabelsData\":\n    from skimage.filters import threshold_otsu\n    binary_image = image > threshold_otsu(image)\n\n    from skimage.measure import label\n    return label(binary_image)\n```\n\nFurthermore, please add your function to the napari.yaml which uses [npe2](https://github.com/napari/npe2):\n```\nname: napari-npe2-test\ndisplay_name: napari-npe2-test\ncontributions:\n  commands: \n    - id: napari-npe2-test.make_magic_widget\n      python_name: napari_npe2_test._widget:example_magic_widget\n      title: Make example magic widget\n  widgets:\n    - command: napari-npe2-test.make_magic_widget\n      display_name: Segmentation / labeling > Otsu Labeling (nnpe2t)\n```\n\nTo put it in the right button within the napari-assistant, please use one of the following prefixes for the `display_name`:\n* `Filtering / noise removal > `\n* `Filtering / background removal > `\n* `Filtering > `\n* `Image math > `\n* `Transform > `\n* `Projection > `\n* `Segmentation / binarization > `\n* `Segmentation / labeling > `\n* `Segmentation post-processing > `\n* `Measurement > `\n* `Label neighbor filters > `\n* `Label filters > `\n* `Visualization > `\n\nYou find a fully functional example [here](https://github.com/haesleinhuepf/napari-npe2-test).\n\nLast but not least, to make your napari-plugin is listed in the napari-hub when searching for \"napari-assistant\", make sure\nyou mention it in your `readme`.\n\n## Feedback welcome!\n\nThe napari-assistant is developed in the open because we believe in the open source community. Feel free to drop feedback as [github issue](https://github.com/haesleinhuepf/napari-assistant/issues) or via [image.sc](https://image.sc)\n\n## Contributing\n\nContributions are very welcome. Please ensure\nthe test coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [BSD-3] license,\n\"napari-assistant\" is free and open source software\n\n## Acknowledgements\nThis project was supported by the Deutsche Forschungsgemeinschaft under Germany\u2019s Excellence Strategy \u2013 EXC2068 - Cluster of Excellence \"Physics of Life\" of TU Dresden. \nThis project has been made possible in part by grant number [2021-240341 (Napari plugin accelerator grant)](https://chanzuckerberg.com/science/programs-resources/imaging/napari/improving-image-processing/) from the Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation.\n\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "A pocket calculator like interface to image processing in napari",
    "version": "0.4.11",
    "project_urls": {
        "Bug Tracker": "https://github.com/haesleinhuepf/napari-assistant/issues",
        "Documentation": "https://github.com/haesleinhuepf/napari-assistant/",
        "Homepage": "https://github.com/haesleinhuepf/napari-assistant/",
        "Source Code": "https://github.com/haesleinhuepf/napari-assistant",
        "User Support": "https://forum.image.sc/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98fd8584273d7b9d54f240bb126266967a511cdd2920afb5e93a4218c3e3c781",
                "md5": "ec041f3444b4c07239ea0e2204f2926b",
                "sha256": "0ac24a0d7d797e7c44cbfaeeda5c88da3f3166272f0f97c1f43c5a4bb87cda24"
            },
            "downloads": -1,
            "filename": "napari_assistant-0.4.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ec041f3444b4c07239ea0e2204f2926b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 318916,
            "upload_time": "2024-12-06T06:53:07",
            "upload_time_iso_8601": "2024-12-06T06:53:07.720655Z",
            "url": "https://files.pythonhosted.org/packages/98/fd/8584273d7b9d54f240bb126266967a511cdd2920afb5e93a4218c3e3c781/napari_assistant-0.4.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7a2ad09e5200f6464cda021f5a8baff4359e5c06f4dd78619d98d7069c6a914",
                "md5": "b1c9bc17284712a4a7ff3895e29b170f",
                "sha256": "4deabcdc53d0eb2ac2e3ddc7098eaca2956b7f6c31368feb978417f7581fd409"
            },
            "downloads": -1,
            "filename": "napari_assistant-0.4.11.tar.gz",
            "has_sig": false,
            "md5_digest": "b1c9bc17284712a4a7ff3895e29b170f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 287658,
            "upload_time": "2024-12-06T06:53:09",
            "upload_time_iso_8601": "2024-12-06T06:53:09.210050Z",
            "url": "https://files.pythonhosted.org/packages/d7/a2/ad09e5200f6464cda021f5a8baff4359e5c06f4dd78619d98d7069c6a914/napari_assistant-0.4.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-06 06:53:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "haesleinhuepf",
    "github_project": "napari-assistant",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "napari-plugin-engine",
            "specs": [
                [
                    ">=",
                    "0.1.4"
                ]
            ]
        },
        {
            "name": "toolz",
            "specs": []
        },
        {
            "name": "napari",
            "specs": [
                [
                    ">=",
                    "0.4.14"
                ]
            ]
        },
        {
            "name": "magicgui",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "!=",
                    "1.19.4"
                ]
            ]
        },
        {
            "name": "pyperclip",
            "specs": []
        },
        {
            "name": "loguru",
            "specs": []
        },
        {
            "name": "jupytext",
            "specs": []
        },
        {
            "name": "jupyter",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "napari-time-slicer",
            "specs": [
                [
                    ">=",
                    "0.4.4"
                ]
            ]
        },
        {
            "name": "napari-workflows",
            "specs": [
                [
                    ">=",
                    "0.2.4"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "napari-assistant"
}
        
Elapsed time: 2.87018s