InsightSoftwareConsortium / InsightSoftwareConsortium/itkwidgets

Unable to Save Widget State

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

Description

Hi Folks,

I'm looking at how to interact with itkwidget's state in the jupyter notebook and jupyer lab. Although I can:

- open jupyter lab
- open a notebook with an ITK plotter in use
- run the cell to get the 3D widget rendered
- save close and reopen the notebook (without closing lab)
- the 3D widget still appears immediately.

![Screenshot 2020-10-27 at 11 52 23](https://user-images.githubusercontent.com/1473646/97298533-746f5800-184b-11eb-8f24-6d1194e306af.png)

But if I close jupyter lab completely, or kill the active kernel, then reopen it and the notebook, the 3D plot is not visible and I get a message from the extension that it cannot find the model.

In Jupyter lab, i have selected the "Save Widget State Automatically" setting which for ipywidgets serialises the model to the notebook metadata, so that widgets are re-rendered when the notebook is opened.

![Screenshot 2020-10-27 at 11 45 48](https://user-images.githubusercontent.com/1473646/97298542-76d1b200-184b-11eb-9950-08b7a58f422c.png)

However, the itk widgets state is not saved.

In parallel, when using the classic notebook there are various controls in the Widgets menu allowing a user to save/download/embed widgets state and these do nothing for my notebook containing the ITKPlotter.

Is this because the itkwidget extension needs to implement something in order to support saving/serialisation of the state?

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.