Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using pyclesperanto_assistant operations in other napari plugins #38

Open
pr4deepr opened this issue Nov 29, 2021 · 2 comments
Open

using pyclesperanto_assistant operations in other napari plugins #38

pr4deepr opened this issue Nov 29, 2021 · 2 comments

Comments

@pr4deepr
Copy link
Member

Hi @haesleinhuepf
Great work with the napari assistant.

I have a question about translating a workflow generated in napari_pyclesperanto_assistant within other napari plugins.

Say, if I have a plugin to deskew a lattice lightsheet file, I'd like the user to test an image processing workflow using clesperanto_assistant on a few stacks. For example, filtering and binarising a deskewed image. Once the user is happy with the settings, they would then run a batch process, where

  • deskewing (plugin A)
  • and the image processing (pyclesperanto)

is applied to the whole file and the final processed stack is saved. This is all to be done within the napari environment (for now).

I really like this idea of defining workflows and wondering if I can access it from clesperanto_assistant?
https://github.com/clEsperanto/pyclesperanto_prototype/blob/master/demo/optimization/workflow_dask.ipynb

Perhaps via this function?

Cheers
Pradeep

@pr4deepr pr4deepr changed the title exporting workflow operations only using pyclesperanto_assistant operations in other napari plugins Nov 29, 2021
@haesleinhuepf
Copy link
Member

haesleinhuepf commented Nov 29, 2021

Hi Pradeep,

great timing! I just moved the Workflow class into the napari-time-slicer plugin. Check out its readme. There you find a list of plugins that are compatible and we should add yours! If you use time_slicer in your plugin, it will then allow users to knit workflows which contain your deskew step and others. It also allows to apply the deskewing to multiple time frames, e.g. if the whole time lapse is loaded as 4D dask array. And, you can generate code from a workflow that's open in napari.

Your code should then roughly look like this:

@time_slicer
def deskew(image:napari.types.ImageData, angle, direction, viewer:napari.Viewer) -> napari.types.ImageData:
    ...

Oh and, the napari-assistant (note: clesperanto will be missing in the name) will later bring a new user interface with buttons, where all plugins are available, that are annotated with time_slicer or some others I have in mind...

Let me know if this makes sense!

Cheers,
Robert

@pr4deepr
Copy link
Member Author

Hi Robert
Thanks for this. This is what I'm looking for. This looks really good. I saw the plugin earlier, but didn't realise immediately what it did.
Pretty sure I'll be getting in touch regarding getting it working!

Cheers
Pradeep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants