Package: napari-assistant
napari-assistantThe napari-assistant is anaparimeta-plugin for building image processing workflows.UsageAfter installing one or more napari plugins that use the napari-assistant as user interface, you can start it from the
menuTools > Utilities > Assistant (na)or runnapariafrom the command line.By clicking on the buttons in the assistant, you can setup a workflow for processing the images.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).Saving and loading workflowsYou can also save and load workflows to disk.After loading a workflow, make sure that the right input images are selected.Code generationThe napari-assistant allows exporting the given workflow as Python script and Jupyter Notebook.Furthermore, if you have thenapari-script-editorinstalled,
you can also send the current workflow as code to the script editor from the same menu.Plugin generationThere is also a Napari plugin generator available. Check outits documentationto learn how napari-assistant compatible plugins can be generated directly from within the assistant.InstallationIt 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 assistanton the napari-hub.
Multiple of these plugins come bundled when installingdevbio-napari.For developersIf 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:defexample_function_widget(image:"napari.types.ImageData")->"napari.types.LabelsData":fromskimage.filtersimportthreshold_otsubinary_image=image>threshold_otsu(image)fromskimage.measureimportlabelreturnlabel(binary_image)Furthermore, please add your function to the napari.yaml which usesnpe2: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 thedisplay_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 examplehere.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 yourreadme.Feedback welcome!The napari-assistant is developed in the open because we believe in the open source community. Feel free to drop feedback asgithub issueor viaimage.scContributingContributions are very welcome. Please ensure
the test coverage at least stays the same before you submit a pull request.LicenseDistributed under the terms of theBSD-3license,
"napari-assistant" is free and open source softwareAcknowledgementsThis 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 number2021-240341 (Napari plugin accelerator grant)from the Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation.