Closed thewtex closed 3 years ago
Thanks @thewtex !
Yes, I think it would be cool, I will paste a gif here to see what can we do with this additional imjoy-rpc support.
In the example below, we start a jupyter notebook inside ImJoy (with RPC supported), then it can use the rpc to call other plugins, including the itk-vtk-viewer (my forked version with the above modifications).
As you can see, I can call viewer= await api.showDialog(src="https://oeway.github.io/itk-vtk-viewer/?imjoy=1")
and viewer.imshow(imageio.imread(MY_IMAGE_FILE))
in Python, and I got a dialog with the numpy image loaded to the itk-vtk-viewer:
Update: we have been refining the internal encoding for the ImJoy RPC library, so the above code won't work with the latest imjoy app, a working version can be find here: https://github.com/oeway/itk-vtk-viewer/blob/master/dist/index.html
As suggested by @oeway, something like: