InsightSoftwareConsortium / InsightSoftwareConsortium/itkwidgets

"Viewer 1" updates/requests fail once "Viewer 2" is created

Open
#708 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
624
Forks
83
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/Kitware/itk-vtk-viewer/blob/master/src/ImJoyPluginAPI.js) available after another window is created.

@oeway Have you seen behavior like this before?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.