Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualization problem using visbrain #97

Open
aya-almasri opened this issue May 26, 2021 · 3 comments
Open

Visualization problem using visbrain #97

aya-almasri opened this issue May 26, 2021 · 3 comments

Comments

@aya-almasri
Copy link

Hi,
I have a problem with the vizualisation using Visbrain.
I am just installing the ‘Slam’ environment, on my Windows 10 system, as indicated in the GitHub https://brain-slam.github.io/slam/, by relying on an anaconda virtual environment.
conda create -q -n slam python=3.6
conda activate slam

pip install brain-slam

I started by trying to run the examples provided https://brain-slam.github.io/slam/auto_examples/index.html

For example, the one entitled ‘Example of curvature estimation in slam’, and I obtained the following error: “No module named Visbrain”.
So I installed Visbrain as indicated the following website : https://github.com/EtienneCmb/visbrain
First, I installed the Visbrain requires, before installed Visbrain.
• NumPy >= 1.13
• SciPy
• VisPy >= 0.5.3
• Matplotlib >= 1.5.5
• PyQt5
• Pillow
• PyOpenGL
I tried again to run the example ‘Example of curvature estimation in slam’, and I obtain the following error:
runfile('C:/Users/Ayama/stage/slam-master/examples/example_curvature.py', wdir='C:/Users/Ayama/stage/slam-master/examples')
Calculating vertex normals .... Please wait
Finished calculating vertex normals
Calculating curvature tensors ... Please wait
Finished Calculating curvature tensors
Calculating Principal Components ... Please wait
Finished Calculating principal components
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\line\line.py:395: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
('color', np.float32, 4)])
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\line\arrow.py:57: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
('linewidth', np.float32, 1)
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\isocurve.py:22: UserWarning: VisPy is not yet compatible with matplotlib 2.2+
warnings.warn("VisPy is not yet compatible with matplotlib 2.2+")
BrainObj(name='gui') created
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\gloo\buffer.py:454: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
data = data.view(dtype=[('f0', data.dtype.base, c)])
Creation of a scene
BrainObj(name='gui') added to the scene
WARNING | Data defined on a dense grid; ignore smoothing.
Add data to specific vertices.
Data scaled between (-0.419, 0.595)
Get colorbar properties from BrainObj(name='gui') object
ColorbarObj(name='guiCbar') created
ColorbarObj(name='guiCbar') added to the scene
WARNING | dpi parameter is not active if print_size is None. Use for example print_size=(5, 5)
Traceback (most recent call last):

File "C:\Users\Ayama\anaconda3\envs\slam\lib\urllib\request.py", line 1349, in do_open
encode_chunked=req.has_header('Transfer-encoding'))

File "C:\Users\Ayama\anaconda3\envs\slam\lib\http\client.py", line 1287, in request
self._send_request(method, url, body, headers, encode_chunked)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\http\client.py", line 1333, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\http\client.py", line 1282, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\http\client.py", line 1042, in _send_output
self.send(msg)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\http\client.py", line 980, in send
self.connect()

File "C:\Users\Ayama\anaconda3\envs\slam\lib\http\client.py", line 952, in connect
(self.host,self.port), self.timeout, self.source_address)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\socket.py", line 704, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):

File "C:\Users\Ayama\anaconda3\envs\slam\lib\socket.py", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\util\fetching.py", line 239, in _fetch_file
data = urllib.request.urlopen(url, timeout=15.)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\urllib\request.py", line 223, in urlopen
return opener.open(url, data, timeout)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\urllib\request.py", line 526, in open
response = self._open(req, data)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\urllib\request.py", line 544, in _open
'_open', req)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\urllib\request.py", line 1377, in http_open
return self.do_open(http.client.HTTPConnection, req)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\urllib\request.py", line 1351, in do_open
raise URLError(err)

URLError: <urlopen error [Errno 11001] getaddrinfo failed>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\Ayama\AppData\Roaming\Python\Python36\site-packages\visbrain\io\write_image.py", line 393, in write_fig_canvas
img = canvas.render(region=region)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\scene\canvas.py", line 244, in render
self._draw_scene(bgcolor=bgcolor)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\scene\canvas.py", line 253, in _draw_scene
self.draw_visual(self.scene)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\scene\canvas.py", line 291, in draw_visual
node.draw()

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\scene\visuals.py", line 98, in draw
self._visual_superclass.draw(self)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\visual.py", line 588, in draw
v.draw()

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\scene\visuals.py", line 98, in draw
self._visual_superclass.draw(self)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\visual.py", line 432, in draw
if self._prepare_draw(view=self) is False:

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\text\text.py", line 446, in _prepare_draw
self._font._lowres_size) for t in text])

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\text\text.py", line 446, in
self._font._lowres_size) for t in text])

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\text\text.py", line 157, in _text_to_vbo
glyph = font[char]

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\text\text.py", line 69, in getitem
self._load_char(char)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\text\text.py", line 83, in _load_char
_load_glyph(self._font, char, self._glyphs)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\util\fonts_freetype.py", line 50, in _load_glyph
face = _load_font(f['face'], f['bold'], f['italic'])

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\util\fonts_freetype.py", line 34, in _load_font
fname = _get_vispy_font_filename(face, bold, italic)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\util\fonts_vispy_fonts.py", line 20, in _get_vispy_font_filename
return load_data_file('fonts/%s' % name)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\util\fetching.py", line 68, in load_data_file
_fetch_file(url, fname)

File "C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\util\fetching.py", line 243, in _fetch_file
'Dataset fetching aborted (%s)' % (url, e))

RuntimeError: Error while fetching file http://github.com/vispy/demo-data/raw/master/fonts/OpenSans-Bold.ttf.
Dataset fetching aborted (<urlopen error [Errno 11001] getaddrinfo failed>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\Ayama\stage\slam-master\examples\example_curvature.py", line 48, in
visb_sc.preview()

File "C:\Users\Ayama\AppData\Roaming\Python\Python36\site-packages\visbrain\objects\scene_obj.py", line 684, in preview
mpl_preview(self.canvas, widget=self.canvas.central_widget)

File "C:\Users\Ayama\AppData\Roaming\Python\Python36\site-packages\visbrain\io\write_image.py", line 454, in mpl_preview
img = write_fig_canvas(None, canvas, **kw)[..., 0:-1]

File "C:\Users\Ayama\AppData\Roaming\Python\Python36\site-packages\visbrain\io\write_image.py", line 395, in write_fig_canvas
raise ValueError("Can not render the canvas. Try to decrease the "

ValueError: Can not render the canvas. Try to decrease the resolution

@EtienneCmb
Copy link
Owner

EtienneCmb commented May 26, 2021

Hi @A-almasri ,

There are many different errors in your outputs. I propose to first create a simple test.py with the following code inside :

from visbrain.objects import BrainObj

BrainObj('B1').preview()

And then run your script. Do you have errors?

@aya-almasri
Copy link
Author

aya-almasri commented Jun 1, 2021

Hi @EtienneCmb ,

Thank you for your response.
After running the script, I correctly obtained the result of the visualization :
image

The following is shown in the Python console:

C:\Users\Ayama\anaconda3\envs\slam\python.exe C:/Users/Ayama/PycharmProjects/my_work_slam/visbrain_functioning_test.py
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\line\line.py:395: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
('color', np.float32, 4)])
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\line\arrow.py:57: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
('linewidth', np.float32, 1)
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\visuals\isocurve.py:22: UserWarning: VisPy is not yet compatible with matplotlib 2.2+
warnings.warn("VisPy is not yet compatible with matplotlib 2.2+")
BrainObj(name='B1') created
Downloading C:\Users\Ayama\visbrain_data\templates\B1.npz
STATUS : 100.0% 2375680 / 2372325
C:\Users\Ayama\anaconda3\envs\slam\lib\site-packages\vispy\gloo\buffer.py:454: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
data = data.view(dtype=[('f0', data.dtype.base, c)])

Kindly,

@ZhengL97
Copy link

ZhengL97 commented Jun 3, 2021

Hi, it seems that you should upgrade your version of matplotlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants