itkwidgets
itkwidgets copied to clipboard
"Viewer 1" updates/requests fail once "Viewer 2" is created
When there are multiple viewers within one notebook only calls to the most recently created viewer succeed. For example:
viewer_1 = view(image)
viewer.set_rotate(True) # succeeds
viewer_2 = view(image)
viewer.set_rotate(False) # fails
viewer_2.set_rotate(True) # succeeds
Originally this seemed to be related to the major updates now available in v1.0a41 - For example, the cells
annotations = viewer.get_annotations_enabled
annotations
return
TypeError: Cannot read properties of undefined (reading 'getAnnotationsEnabled')
Testing with previous releases shows that this is actually a long-standing issue. It seems that the reference to the window object returned from api.createWindow no longer has the ImJoyPluginAPI available after another window is created.
@oeway Have you seen behavior like this before?
I like the improvement @oeway made with hypha -- it is more functional, passing a reference to all objects used in the API, like the viewer in this case. Maybe need a version of that with the imjoy rpc?
Hi, guys, yeah, I will need to investigate it a bit to see how to fix! Or maybe a more sustainable plan is to migrate to hypha RPC in ImJoy.
Unfortunately, I am a bit overloaded at the moment, will have to look into this in 2024!