Esempio n. 1
0
brainrender.SHOW_AXES = True

# Create Scene
scene = Scene()

# add brain regions
mos, hy = scene.add_brain_regions(["MOs", "HY"], alpha=0.2)
mos.wireframe()
hy.wireframe()

# Get center of mass of the two regions
p1 = scene.atlas.get_region_CenterOfMass("MOs")
p2 = scene.atlas.get_region_CenterOfMass("HY")

# Use the ruler class to display the distance between the two points
"""
    Brainrender units are in micrometers. To display the distance
    measure instead we will divide by a factor of 1000 using 
    the unit_scale argument.
"""

# Add a ruler form the brain surface
scene.add_ruler_from_surface(p2)

# Add a ruler between the two regions
scene.add_actor(ruler(p1, p2, unit_scale=0.01, units="mm"))

# render
scene.render()
Esempio n. 2
0
brainrender.SHOW_AXES = True

scene = Scene(title="Test Scene")

# add brain regions
mos, hy = scene.add_brain_regions(["MOs", "HY"], alpha=0.2)
mos.wireframe()
hy.wireframe()

# Get center of mass of the two regions
p1 = scene.atlas.get_region_CenterOfMass("MOs")
p2 = scene.atlas.get_region_CenterOfMass("HY")
scene.add_sphere_at_point(p1, radius=200)

# Add a ruler form the brain surface
scene.add_ruler_from_surface(p2, unit_scale=0.001)

# Add a ruler between the two regions
scene.add_actor(ruler(p1, p2, unit_scale=0.001, units="mm"))

# Cut with plane
stn = scene.add_brain_regions("STR", hemisphere="right").alpha(0.4)
scene.cut_actors_with_plane("sagittal", actors=hy)

# Fake render
scene.render(interactive=False)

# Add more regions and silhouettes
ca1 = scene.add_brain_regions("CA1", alpha=0.4)
scene.add_silhouette(ca1)