Created
May 4, 2020 10:10
-
-
Save oeway/2b91c72b20cdc025e3ee3f95c8faa28a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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