class eelbrain.plot._brain_object.Brain(subject, hemi, surf='inflated', title=None, cortex='classic', alpha=1.0, background='white', foreground='black', subjects_dir=None, views='lat', offset=True, show_toolbar=False, offscreen=False, interaction='trackball', w=None, h=None, axw=None, axh=None, name=None, pos=None, source_space=None, show=True, run=None)

PySurfer Brain subclass returned by plot.brain functions

PySurfer surfer.Brain subclass adding Eelbrain GUI integration and methods to visualize data in NDVar format.

  • subject (str) – Subject name.

  • hemi ('lh' | 'rh' | 'both' | 'split') – ‘both’: both hemispheres are shown in the same window; ‘split’: hemispheres are displayed side-by-side in different viewing panes.

  • surf (str) – Freesurfer surface mesh name (ie ‘white’, ‘inflated’, etc.).

  • title (str) – Title for the window.

  • cortex (str, tuple, dict, or None) –

    Specifies how the cortical surface is rendered. Options:

    1. The name of one of the preset cortex styles: 'classic' (default), 'high_contrast', 'low_contrast', or 'bone'.

    2. A color-like argument to render the cortex as a single color, e.g. 'red' or (0.1, 0.4, 1.). Setting this to None is equivalent to (0.5, 0.5, 0.5).

    3. The name of a colormap used to render binarized curvature values, e.g., Grays.

    4. A list of colors used to render binarized curvature values. Only the first and last colors are used. E.g., [‘red’, ‘blue’] or [(1, 0, 0), (0, 0, 1)].

    5. A container with four entries for colormap (string specifiying the name of a colormap), vmin (float specifying the minimum value for the colormap), vmax (float specifying the maximum value for the colormap), and reverse (bool specifying whether the colormap should be reversed. E.g., ('Greys', -1, 2, False).

    6. A dict of keyword arguments that is passed on to the call to surface.

  • alpha (float in [0, 1]) – Alpha level to control opacity of the cortical surface.

  • background (matplotlib colors) – color of the background and foreground of the display window

  • foreground (matplotlib colors) – color of the background and foreground of the display window

  • subjects_dir (str | None) – If not None, this directory will be used as the subjects directory instead of the value set using the SUBJECTS_DIR environment variable.

  • views (list | str) – views to use

  • offset (bool) – If True, aligs origin with medial wall. Useful for viewing inflated surface where hemispheres typically overlap (Default: True)

  • show_toolbar (bool) – If True, toolbars will be shown for each view.

  • offscreen (bool) – If True, rendering will be done offscreen (not shown). Useful mostly for generating images or screenshots, but can be buggy. Use at your own risk.

  • interaction (str) – Can be “trackball” (default) or “terrain”, i.e. a turntable-style camera.

  • w (int) – Figure width and height.

  • h (int) – Figure width and height.

  • axw (int) – Width and height of the individual viewing panes.

  • axh (int) – Width and height of the individual viewing panes.

  • name (str) – Window title (alternative to title for consistency with other Eelbrain figures).

  • pos (tuple of int) – Position of the new window on the screen.

  • show (bool) – Currently meaningless due to limitation in VTK that does not allow hidden plots.

  • run (bool) – Run the Eelbrain GUI app (default is True for interactive plotting and False in scripts).


The documentation lists only the methods that Eelbrain adds to or overrides from the PySurfer Brain super-class. For complete PySurfer functionality see te PySurfer documentation.


add_label(label[, color, alpha, ...])

add_mask(source[, color, smoothing_steps, ...])

Add a mask shading areas that are not included in an NDVar

add_ndvar(ndvar[, cmap, vmin, vmax, ...])

Add data layer form an NDVar

add_ndvar_annotation(ndvar[, colors, ...])

Add annotation from labels in an NDVar

add_ndvar_label(ndvar[, color, borders, ...])

Draw a boolean NDVar as label.

add_ndvar_p_map(p_map[, param_map, p0, p1, ...])

Add a map of p-values as data-layer


Close the figure window


Copy the currently shown image to the clipboard


Find source space vertice by right-clicking on the brain


Retrieve the current time


(vmin, vmax) for the most recently added data layer

image([name, format, alt, mode])

Create an FMText Image from a screenshot


Link the time axis of this figure with another figure

play_movie([tstart, tstop, fps])

Play an animation by setting time

plot_colorbar([label, label_position, ...])

Plot a colorbar corresponding to the displayed data

plot_legend(*args, **kwargs)

Plot legend for parcellation


Remove data shown with Brain.add_ndvar

remove_labels([labels, mask])

Remove labels shown with Brain.add_ndvar_label

save_image(filename[, mode, antialiased, ...])

Save view from all panels to disk

set_parallel_view([forward, up, scale])

Set view to parallel projection

set_size(width, height)

Set image size in pixels



Set the time point to display


Set the window title

set_vlim([v, vmax])

Change the colormap limits