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, 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, h : int

Figure width and height.

axw, 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(self, label[, color, alpha, …])
add_mask(self, source[, color, …]) Add a mask shading areas that are not included in an NDVar
add_ndvar(self, ndvar[, cmap, vmin, vmax, …]) Add data layer form an NDVar
add_ndvar_annotation(self, ndvar[, colors, …]) Add annotation from labels in an NDVar
add_ndvar_label(self, ndvar[, color, …]) Draw a boolean NDVar as label.
add_ndvar_p_map(self, p_map[, param_map, …]) Add a map of p-values as data-layer
close(self) Close the figure window
copy_screenshot(self) Copy the currently shown image to the clipboard
enable_vertex_selection(self[, color]) Find source space vertice by right-clicking on the brain
get_time(self) Retrieve the current time
get_vlim(self) (vmin, vmax) for the most recently added data layer
image(self[, name, format, alt, mode]) Create an FMText Image from a screenshot
link_time_axis(self, other) Link the time axis of this figure with another figure
play_movie(self[, tstart, tstop, fps]) Play an animation by setting time
plot_colorbar(self[, label, label_position, …]) Plot a colorbar corresponding to the displayed data
plot_legend(self, *args, **kwargs) Plot legend for parcellation
remove_data(self[, hemi]) Remove data shown with Brain.add_ndvar
remove_labels(self[, labels]) Remove labels shown with Brain.add_ndvar_label
save_image(self, filename[, mode, antialiased]) Save view from all panels to disk
set_parallel_view(self[, forward, up, scale]) Set view to parallel projection
set_size(self, width, height) Set image size in pixels
set_surf(self, surf)
set_time(self, time) Set the time point to display
set_title(self, title) Set the window title
set_vlim(self[, v, vmax]) Change the colormap limits