ImJoy
ImJoy copied to clipboard
Image viewer with Annotations
I would be a great feature if ImJoy would provide a flexible plugin that allows displaying 2d/3d images (with a hoover to indicate pixel coordinates and pixel intensities).
Further, combining this with the possibility to perform /display annotations would provide a general-purpose plugin that would certainly be useful for many applications.
Working on it, will update this thread when it's ready.
Checkout a prototype here: https://imjoy.io/lite?plugin=https://gist.github.com/oeway/531c2f72ff712414f2229f9f8b522464
Update: with two recent PRs (https://github.com/imjoy-team/jupyter-engine-manager/pull/24 and https://github.com/imjoy-team/imjoy-engine/pull/90 ) You can now send ndarray between the browser and the jupyter engine. This enables sending numpy images to show in the image viewer.
This is an example plugin in Python which uses the ImageViewer to display image:
from imjoy import api
import numpy as np
from imageio import imread
class ImJoyPlugin():
def setup(self):
api.log('initialized')
async def run(self, ctx):
image_array = imread('https://images.proteinatlas.org/115/663_E2_1_blue_red_green.jpg')
# pass the image_array directly
p = await api.showDialog(type='ImageViewer', name="Show image with ImageViewer", data={"image_array": image_array})
# or call the imshow function defined in the viewer
# await p.imshow(image)
api.export(ImJoyPlugin())
You can also click here to install a demo python plugin: https://imjoy.io/#/app?plugin=https://gist.githubusercontent.com/oeway/531c2f72ff712414f2229f9f8b522464/raw/ViewImageInPython.imjoy.html
Notice that you need to make sure you use the latest version of the Jupyter Engine Manager (> v0.3.27), the latest version of ImJoy-Engine (run pip install -U imjoy). If the ImageViewer is not installed, then install it from https://gist.github.com/oeway/531c2f72ff712414f2229f9f8b522464
Then you should get this:
