enthought / enthought/mayavi

itk backend RuntimeError: Could not process the viewer data

Open
#1,202 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

Follow the https://github.com/enthought/mayavi/blob/master/examples/mayavi/mayavi_jupyter.ipynb

![image](https://user-images.githubusercontent.com/28699575/212167636-2465c8ee-e548-4e22-9fb1-c3cf879e03d4.png)

```shell
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
File ~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:920, in IPythonDisplayFormatter.__call__(self, obj)
918 method = get_real_method(obj, self.print_method)
919 if method is not None:
--> 920 method()
921 return True

File ~/anaconda3/envs/WaveletGeneration/lib/python3.8/site-packages/mayavi/tools/notebook.py:31, in _ipython_display_(self)
22 def _ipython_display_(self):
23 '''Method attached to Mayavi objects.
24
25 Note that here `self` is the Mayavi object that is going to be
(...)
29
30 '''
---> 31 return _backend.display(self)

File ~/anaconda3/envs/WaveletGeneration/lib/python3.8/site-packages/mayavi/tools/notebook.py:145, in ITKBackend.display(self, obj)
137 # Works around bug in released itkwidgets-0.32.1.
138 # Can remove when this PR is merged and in a release:
139 # https://github.com/InsightSoftwareConsortium/itkwidgets/pull/438
140 kw = dict(
141 actors=actors, geometries=[], geometry_colors=[],
142 geometry_opacities=[], point_sets=[], point_set_colors=[],
143 point_set_opacities=[]
144 )
--> 145 return idisplay(self._view(**kw))
146 else:
147 return obj

File ~/anaconda3/envs/WaveletGeneration/lib/python3.8/site-packages/itkwidgets/viewer.py:436, in view(data, **kwargs)
322 def view(data=None, **kwargs):
323 """View the image and/or point sets.
324
325 Creates and returns an ImJoy plugin ipywidget to visualize an image, and/or
(...)
434 properties on the object to change the visualization.
435 """
--> 436 viewer = Viewer(data=data, **kwargs)
438 return viewer

File ~/anaconda3/envs/WaveletGeneration/lib/python3.8/site-packages/itkwidgets/viewer.py:136, in Viewer.__init__(self, ui_collapsed, rotate, ui, **add_data_kwargs)
132 def __init__(
133 self, ui_collapsed=True, rotate=False, ui="pydata-sphinx", **add_data_kwargs
134 ):
135 input_data = self.input_data(add_data_kwargs)
--> 136 data = self.init_data(input_data)
137 """Create a viewer."""
138 self.viewer_rpc = ViewerRPC(
139 ui_collapsed=ui_collapsed, rotate=rotate, ui=ui, data=data
140 )

File ~/anaconda3/envs/WaveletGeneration/lib/python3.8/site-packages/itkwidgets/viewer.py:179, in Viewer.init_data(self, input_data)
177 result = _get_viewer_point_sets(data)
178 if result is None:
--> 179 raise RuntimeError(f"Could not process the viewer {input_type}")
180 _init_data[key] = result
181 return _init_data

RuntimeError: Could not process the viewer data

````

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing examples/mayavi/mayavi_jupyter.ipynb in the reported Python 3.8 environment and inspect mayavi/tools/notebook.py, especially ITKBackend.display. Compare the data passed to itkwidgets.view with the viewer error; done means the IsoSurface displays in the notebook without RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.