I am using brainrender to show where I've placed some electrodes. However, whenever I load brainrender my brain always loads upside down:
brainrender
Is there a way to fix this? Or do I just have to manually flip it every time?
I was also wondering if any one knew of a way to display/add text labels to the 3D image the brainrender makes? I did look at these functions, but as far as I can tell neither one actually places a label on a brain area.
labels:
Below I've copied the important parts of how to resolve the issues/questions posted here. All credit for an answer to this question goes to the developer of BrainRender(FedeClaudi on GitHub). I am copying the key information he provide my team in case the following link to the developers answer stops working: https://github.com/BrancoLab/BrainRender/issues/70
The developer of the BrainRender tool updated this tool to version 0.4.0.0 which allows users to permanently add labels to brain areas:
pip install -U brainrender
You should also update using:
https://github.com/BrancoLab/BrainRender.git
Some key things to know about how the labels work:
Labels appear on the right hemisphere by default
added xoffset
, yoffset
and zoffset
to manually alter the location of the label
added a colored sphere to the point on the mesh that corresponds to the label location [optional]
This is how we resolved our brain loading upside down, it turns out this is just an issue that occurs with Jupyter notebook:
from vtkplotter import embedWindow
from brainrender.scene import Scene
# Change 1 Disable scene embedding with k3d in vtkplotter
embedWindow(False)
# Change 2 set jupyter to False when creating the scene
scene = Scene(jupyter=False)
# Populate and render
scene.add_brain_regions(['MOp', 'MOs', 'VISl', 'VISp', 'RSPagl'], add_labels=True)
scene.add_text('title')
scene.render(camera='top')
The developer also warned "to avoid import vtkplotter as vtk
because there's another package called vtk
".