brainglobe-atlasapi
brainglobe-atlasapi copied to clipboard
kim_mouse atlas plots only one hemisphere in brainrender
Using kim_mouse_50um, for which scaling issues have been solved (see brainglobe/brainglobe-atlasapi#247), individual brain regions plot in only one hemisphere or the other. Consider this snippet:
from brainrender import Scene
atlas = 'kim_mouse_50um'
# Create a brainrender scene
scene = Scene(screenshots_folder='.', inset=False, atlas_name=atlas)
# add actors
acbc = scene.add_brain_region('Acb', alpha=0.3, color='blue', hemisphere='both')
# render
scene.render(interactive=False, zoom=1)
scene.screenshot(name='example_{}'.format(atlas))
This produces the following output:
As you can see, the nucleus accumbens gets plotted only in the left hemisphere. This is contrary to the behavior of allen_mouse_25um
and the documented behavior of the hemisphere
parameter. As far as I can tell, this behavior does not affect the structure_from_coords
function, i.e. that function correctly returns the same region regardless of whether the point is in the left or the right hemisphere. It's currently unclear to me whether this is a problem with the atlas API itself or with brainrender, but I figured I'd report the bug here because of the difference between allen_mouse_25um
and kim_mouse_50um
. If I should go to the brainrender Github instead, let me know.
Hey @alowet, I'm not sure where the error lies, maybe @FedeClaudi has some insight?
Visualising the Acb outside of brainrender (.brainglobe/kim_mouse_50um_v1.0/meshes/56.obj
) seems to show both hemispheres.
It seems there are some issues with the obj files for the Kim atlas. I sampled a few other random areas and there's a high chance that the obj files only contain one hemisphere.
Local file downloaded by bg-atlasapi:
File downloaded directly from GIN:
Local copy for the same region in Allen 100 um:
I can reproduce in brainrender-napari
and in Paraview. Is it possible that this affects only mesh files that are supposed to consist of several disconnected parts? Looking eg at Tu1
and Tu2
would support this hypothesis?
Maybe this issue needs to be transferred to bg-atlasgen
as it's likely a problem with https://github.com/brainglobe/bg-atlasgen/blob/main/bg_atlasgen/atlas_scripts/kim_mouse.py? @IgorTatarnikov what do you think?
I would agree, it seems to be an issue with the generation. We should transfer it to bg-atlasgen
!
Regenerating the meshes seems to fix this issue.
This has now been fixed.