InsightSoftwareConsortium / itkwidgets

An elegant Python interface for visualization on the web platform to interactively generate insights into multidimensional images, point sets, and geometry.
https://itkwidgets.readthedocs.io/
Apache License 2.0
579 stars 83 forks source link

AttributeError: 'Viewer' object has no attribute 'add_point_set' #616

Closed sunscale closed 1 year ago

sunscale commented 1 year ago

When I run the example code NumPyArrayPointSet.ipynb, an error occurs:

AttributeError Traceback (most recent call last) Cell In[10], line 1 ----> 1 viewer.add_point_set(point_set_2)

AttributeError: 'Viewer' object has no attribute 'add_point_set'

Is there anything wrong with my installation? Thanks.

bnmajor commented 1 year ago

@sunscale That is likely because that feature is available on master but not yet in a release. I am guessing you are on 1.0a23 at the moment?

Until 1.0a24 is released you can use the master branch a few ways:

  1. Clone and build locally
    1. git clone git@github.com:InsightSoftwareConsortium/itkwidgets.git
    2. cd /path/to/repo
    3. pip install -e ".[all]"
  2. Use the url
    1. Replace the line !{sys.executable} -m pip install -q "itkwidgets[all]>=1.0a23" with !{sys.executable} -m pip install -q git+https://github.com/InsightSoftwareConsortium/itkwidgets.git

Additionally, the default does not yet have suppport for the point set controls. If you would like to use them (to toggle point color, size, shape) you pass ui="reference" to the call to view to get access to those controls for now.

sunscale commented 1 year ago

It works now! Thanks for your kind help.