-
-
Notifications
You must be signed in to change notification settings - Fork 472
Description
Description
Based on some initial discussions between @royerloic and @oeway the idea was floated that Napari and ImJoy could try and share a plugin ecosystem. Both projects aim to make python based image analysis, including packages using deep learning and gpus, more accessible to the masses.
ImJoy is leveraging modern web technology and can be used in a browser whereas Napari is a python package that can be used as a standalone desktop app or with jupyter notebooks. Allowing for shared plugins that could easily be used by both tools could have massive benefits for the user and developer communities.
Here are some comments from @oeway the main ImJoy developer in the napari slack that could be used to get this discussion going:
@royerloic @sofroniewn I like the idea of having a common python plugin infrastucture, here is the current design of ImJoy plugin system:
Here is some ideas behind the plugin system of ImJoy:
- every plugin is a single file with
.imjoy.htmlextension (e.g. link), the annotation declarative scheme we used is a json config block in the plugin file (e.g. link). We use a relatively consistent format across plugins in different languages (Javascript, Python, potentially more, WIP: ImageJ scripts ).- complementary code/modules are provided through
requirements(link). Tags (inspired by docker) can be used to specify different requirements for different branch of the same plugin (e.g. link), the user will need to choose which tag to be used during installation (e.g. link).- plugin files can be hosted anywhere which can be accessed through
httpsurl including Github/Gist/Gitlab, Dropbox or Google drive, and can be withhttps://imjoy.io/#/app?plugin=PLUGIN_URL.- The recommended way of deploying ImJoy plugins is through Github repo, any Github Repo can be transformed into a ImJoy plugin repo by adding a file called
manifest.imjoy.json. ImJoy will render the list of plugins from a repo throughhttps://imjoy.io/#/app?repo=GITHUB_USER/REPO_NAME(e.g. link and link). Another benifit of making a ImJoy repo is, you can then use shorter plugin URI format to refer to the plugin, e.g.: you can use:https://imjoy.io/#/app?plugin=oeway/Anet-Lite:Anet-Liteinstead ofhttps://imjoy.io/#/app?plugin=https://github.com/oeway/Anet-Lite/blob/master/anetLite.imjoy.htmlas described in “3”.- The same plugin URI scheme described in “3" and “4” can be used to describe the dependency of a plugin (e.g. link).
- Each plugin can expose a set of api (at least
setupandrun) throughapi.exportcall (e.g. link), the same applies to different types of plugins. Any plugin can call exported api functions in another plugin, the call can be concurrent throughasync/awaitsyntax in JS and Python- You can describe the inputs/outputs of a plugin with JSON-schema (https://json-schema.org/), it will be helpful for validating the inputs/outputs of a plugin and also for building a computational graph in the future. (e.g. link)
- One thing we really like to push forward is the concept of functional plugins — computational plugins consist of only pure functions with no side-effect (https://www.sitepoint.com/functional-programming-pure-functions/). The advantage of functional plugins is enhanced reproducibility and it allows us to better parallelize the plugin execution in the future. Example of a functional plugin: link. Ideally we would like most of the computational plugins be functional. For the moment, we don’t have a way to validate whether the plugin is functional, it’s upto the developer to add
functionaltoflags(e.g: link), we planed to show afunctionalbadge for those plugin in the plugin list of ImJoy.