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
540 stars 75 forks source link

Rendering with labels not working #234

Closed aboharbf closed 9 months ago

aboharbf commented 1 year ago

Running some simple script in a .py file.

image

I've been getting consistent errors around numpy, though attempts to downgrade it haven't worked. The main issue though is my attempts to add labels only seems to add silhouettes (It seems), and no labels.

image

I am using the latest version of brainrender (2.0.5.5), vedo (2021.0.5), on a Windows 11 machine w/ an intel CPU and a GTX 3080. Any tips on how I can get things working would be excellent.

aboharbf commented 1 year ago

So having successfully downgraded numpy to 1.19.5, I'm now running into a problem simply importing 'Scene', which requires 'numpy.typing', itself introduced in numpy 1.20. Upgrading to exactly numpy 1.2 seems to fix the issue. Maybe the repo should have a .yaml with a working environment?

image

GuillaumeLeGoc commented 1 year ago

I ran into the same kind of problem with scene.add(Point(.....)). Brainrender requires numpy 1.20. Note that recent pandas requires newer versions of numpy, so you need pandas 1.4.4. You can let pip handle that. with pip install numpy==1.20 pandas

adamltyson commented 9 months ago

Hi @aboharbf,

I think these issues are now fixed in the latest release.

This script at least works:

from brainrender import Scene

scene = Scene()
th, mos = scene.add_brain_region("TH", "CA1", alpha=0.3)
scene.add_label(th, "Thalamus")
scene.add_label(mos, "CA1")

scene.render()
labels

If you have any further problems, please let us know.