[Neuroimaging] Combined surface plot using plotting.view_surf function

serafim loukas seralouk at hotmail.com
Mon Nov 18 06:59:09 EST 2019


Dear Nilearn community,

First of all thanks for this beautiful python module.

I am trying to use the “plotting.view_surf” function but instead of plotting only one hemisphere, I want to plot both hemispheres combined.
To do so, I load the individual surfaces (left and right) and I combine them in order to plot them.
However, the surface plot only shows one hemisphere.

Any tip?

My code is:

from nilearn import datasets, plotting
from nilearn.surface import load_surf_data
import numpy as np

fsaverage = datasets.fetch_surf_fsaverage()

left = load_surf_data(fsaverage['pial_left'])
right = load_surf_data(fsaverage['pial_right'])

combined_vertices = np.concatenate([left[0], right[0]])
assert(left[0].shape[0] + right[0].shape[0]== combined_vertices.shape[0])

combined_faces = np.concatenate([left[1], right[1]])
assert(left[1].shape[0] + right[1].shape[0]== combined_faces.shape[0])

combined_surface= [combined_vertices, combined_faces]
view = plotting.view_surf(combined_surface)
view.open_in_browser()

Bests,
Makis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20191118/afdd3c6d/attachment.html>


More information about the Neuroimaging mailing list