google / neuroglancer

WebGL-based viewer for volumetric data
Apache License 2.0
1.02k stars 283 forks source link

Jupyter Notebook Demo outdated and causes errors #609

Open yuvipanda opened 5 days ago

yuvipanda commented 5 days ago

(Amazing project!)

I was trying to work through https://github.com/google/neuroglancer/blob/master/python/examples/jupyter-notebook-demo.ipynb, and discovered that some of the code no longer works. In particular,

with viewer.txn() as s:
    s.layers['segmentation'].segments.update([1752, 88847])
    s.layers['segmentation'].visible = True

causes the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[13], line 2
      1 with viewer.txn() as s:
----> 2     s.layers['segmentation'].segments.update([1752, 88847])
      3     s.layers['segmentation'].visible = True

AttributeError: 'VisibleSegments' object has no attribute 'update'