Skip to content

Instantly share code, notes, and snippets.

@oeway
Last active October 26, 2020 13:15
Show Gist options
  • Save oeway/a1bea43002feb2defc4f3bad7c0a7507 to your computer and use it in GitHub Desktop.
Save oeway/a1bea43002feb2defc4f3bad7c0a7507 to your computer and use it in GitHub Desktop.
from imjoy import api
import imageio
class ImJoyPlugin():
async def setup(self):
api.log('initialized')
async def run(self, ctx):
# run `pip install imjoy-elfinder` and start it by running `imjoy-elfinder` before the following command
fileDialog = await api.showDialog(type="ImJoy elFinder")
files = await fileDialog.getSelections()
image = imageio.imread(files[0].path)
api.showDialog(type="itk-vtk-viewer", src="https://oeway.github.io/itk-vtk-viewer/", data={"image_array": image})
api.export(ImJoyPlugin())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment