napari-segment-blobs-and-things-with-membranes icon indicating copy to clipboard operation
napari-segment-blobs-and-things-with-membranes copied to clipboard

Update plugin to napari.yml format

Open haesleinhuepf opened this issue 11 months ago • 3 comments

git-bob think about how to update the code in this repository to make use of napari's yml plugin definition. You find the documentation for this file format under the headline "npe2 contributions" here: https://github.com/napari/docs/blob/main/docs/naps/6-contributable-menus.md And here: https://github.com/napari/docs/blob/main/docs/plugins/advanced_topics/npe2_migration_guide.md

We basically need to convert all @register_function(menu="My menu") decorations in init.py into the mentioned yaml format, e.g.:

contributions:
  commands:
    - id: nsbatwm.my_menu
      title: My menu
      python_name: nsbatwm.my_menu

  menus:
    napari/layers/context:
      - my_menu: nsbatwm.my_menu

The correct syntax is

napari/layers/<lowercase_menu_name>

for each of the listed contributable menus:

Layers
├─ Visualize
├─ Annotate
├─ Data
├─ Layer Type
├─ Transform
├─ Measure
├─ Filter
├─ Register
├─ Project
├─ Segment
├─ Track
├─ Classify

Note: do not modify init.py . Also provide with the complete list of all functions in the yaml format.

haesleinhuepf avatar Nov 21 '24 07:11 haesleinhuepf