Skip to content

Instantly share code, notes, and snippets.

@oeway
Created May 4, 2020 10:10
Show Gist options
  • Save oeway/2b91c72b20cdc025e3ee3f95c8faa28a to your computer and use it in GitHub Desktop.
Save oeway/2b91c72b20cdc025e3ee3f95c8faa28a to your computer and use it in GitHub Desktop.
import asyncio
import numpy as np
import imageio
from imjoy_rpc import api
class ImJoyPlugin():
def setup(self):
api.log('initialized')
async def run(self, ctx):
fileDialog = await api.showDialog(type="external",
src="http://127.0.0.1:9527/elfinder/")
files = await fileDialog.getSelections()
viewer = await api.showDialog(type="external",
src="https://oeway.github.io/itk-vtk-viewer/?imjoy=1")
image_array = imageio.imread(files[0].path)
viewer.imshow(image_array)
api.export(ImJoyPlugin())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment