Note
Click here to download the full example code or to run this example in your browser via Binder
Glass brain plotting in nilearn#
See Plotting brain images for more plotting functionalities.
Retrieve data from Internet#
from nilearn import datasets
motor_images = datasets.fetch_neurovault_motor_task()
stat_img = motor_images.images[0]
Glass brain plotting: whole brain sagittal cuts#
from nilearn import plotting
plotting.plot_glass_brain(stat_img, threshold=3)

<nilearn.plotting.displays._projectors.OrthoProjector object at 0x7fc1e5dd7130>
Glass brain plotting: black background#
On a black background (option “black_bg”), and with only the x and the z view (option “display_mode”).
plotting.plot_glass_brain(
stat_img, title='plot_glass_brain',
black_bg=True, display_mode='xz', threshold=3)

<nilearn.plotting.displays._projectors.XZProjector object at 0x7fc1d9e7e440>
Glass brain plotting: Hemispheric sagittal cuts#
plotting.plot_glass_brain(stat_img,
title='plot_glass_brain with display_mode="lyrz"',
display_mode='lyrz', threshold=3)
plotting.show()

Total running time of the script: ( 0 minutes 3.266 seconds)
Estimated memory usage: 16 MB