Access parcellation maps in surface space

siibra also provides basic access to surfaces. A popular reference space for the human brain is the freesurfer fsaverage surface. It comes in three variants: white matter surface, pial surface, and inflated surface. Each is shipped with left and right hemispheres separately.

For plotting meshes, most python libraries can be employed. We recommend the plotting module of nilearn.

import siibra
from nilearn import plotting

Load the Julich-Brain parcellation.

julich_brain = siibra.parcellations.get("julich 2.9")

We can tell volumetric from surface spaces using their is_surface attribute.

for space in julich_brain.spaces:
    if space.provides_mesh:
        print(space)

The surface map is accessed using the get map method where we specify the space. Note that we call the method here on the parcellation object, while previous examples usually called it on an atlas object.

mp = julich_brain.get_map(space='fsaverage6')

For surfaces, the fetch() method accepts an additional parameter ‘variant’. If not specified, siibra displays the possible options as a list fetches the first one from the list. Now let us fetch a specific variant and also the hemisphere fragment

mesh = mp.fetch(variant="inflated", fragment="left")

# The returned structure is a dictionary of three numpy arrays representing the
# vertices, faces, and labels respectively. Each vertex defines a 3D surface
# point, while the faces are triplets of indices into the list of vertices,
# defining surface triangles. The labels provide the label index associated with
# each vertex.
print(mesh.keys())
dict_keys(['verts', 'faces', 'labels'])

Most meshes are shipped with a color map which we can fetch from the map object by

julich_brain_cmap = mp.get_colormap()

# Now we can plot the mesh
plotting.view_surf(
    surf_mesh=[mesh['verts'], mesh['faces']],
    surf_map=mesh['labels'],
    cmap=julich_brain_cmap, symmetric_cmap=False, colorbar=False
)


Total running time of the script: (0 minutes 2.188 seconds)

Gallery generated by Sphinx-Gallery