brainglobe / brainrender

a python based software for visualization of neuroanatomical and morphological data.
https://brainglobe.info/documentation/brainrender/index.html
BSD 3-Clause "New" or "Revised" License
547 stars 77 forks source link

vtk9 branch error for the GUI #193

Closed HernandoMV closed 2 years ago

HernandoMV commented 2 years ago

Initializing the GUI throws this error in the vtk9 branch (used it due to closePlotter issues in the main branch, that are caused by the non-installation of the newest version)

KeyError: 'notebookBackend'
Exception ignored in: <function Scene.__del__ at 0x7fa5d95c78b0>
Traceback (most recent call last):
  File "/home/hernandom/anaconda3/envs/brainglobe/lib/python3.9/site-packages/brainrender/scene.py", line 101, in __del__
    self.close()
  File "/home/hernandom/anaconda3/envs/brainglobe/lib/python3.9/site-packages/brainrender/render.py", line 268, in close
    self.plotter.close()
AttributeError: 'NoneType' object has no attribute 'close'
Exception ignored in: <function Scene.__del__ at 0x7fa5d95c78b0>
Traceback (most recent call last):
  File "/home/hernandom/anaconda3/envs/brainglobe/lib/python3.9/site-packages/brainrender/scene.py", line 101, in __del__
    self.close()
  File "/home/hernandom/anaconda3/envs/brainglobe/lib/python3.9/site-packages/brainrender/render.py", line 268, in close
    self.plotter.close()
AttributeError: 'NoneType' object has no attribute 'close'
HernandoMV commented 2 years ago

NotebookBackend error replicated with this:

from brainrender import Scene
from vedo import embedWindow, Plotter, show  # <- this will be used to render an embedded scene 
from itkwidgets import view
embedWindow(None)  # <- this will make your scene popup

from brainrender import Scene

popup_scene = Scene(title='popup')

popup_scene.render()  # press 'Esc' to close!!
HernandoMV commented 2 years ago

New updates. Tried with fresh environment in python3.8, installing the vtk9 branch, and I get the exact same errors

FedeClaudi commented 2 years ago

Hernando, please downgrade vedo to pip install vedo==2021.0.5, more recent versions are no longer supported. With that version it should all work correctly, let me know!

see: https://github.com/brainglobe/bg-heatmaps/issues/7#issuecomment-1055608475

HernandoMV commented 2 years ago

solved!