napari / cookiecutter-napari-plugin

Cookiecutter for napari plugins
BSD 3-Clause "New" or "Revised" License
67 stars 39 forks source link

Add `Container` example and expand other examples for widgets #168

Closed DragaDoncila closed 10 months ago

DragaDoncila commented 11 months ago

This PR improves the example widgets provided in the cookiecutter by:

Feedback welcome!

DragaDoncila commented 11 months ago

Will look into test failures!

GenevieveBuckley commented 10 months ago

Thoughts:

  1. Can we edit the napari.yaml config, so that the display names of the widgets you see from the "Plugins" dropdown menu include the function name that was used to create them. It's not immediately obvious that the "Image Threshold" widget is the container widget demo, etc.
  2. Sometimes the threshold widget functions seem to expect float input datatypes, and sometimes they seem to expect unsigned integer input data. I think we should pick something, and keep it consistent. This might also require re-scaling input images to match the datatype we need (eg: right now if you open the camera image and try to run the very first function widget, you get back an almost entirely solid mask... because almost every pixel in a uint8 image is of course going be larger than 0.5)
  3. You get funny results for RGB input images, with the current threshold implementations. Since the astronaut example image is the first one in the napari sample data list, ideally we should make the demo function work for this (automatically convert to grayscale if needed?).
GenevieveBuckley commented 10 months ago

Next steps: we will also push this commit to the main branch at https://github.com/napari/napari-plugin-template