eelbrain.plot.brain.brain
- eelbrain.plot.brain.brain(src, cmap=None, vmin=None, vmax=None, surf='inflated', views='lateral', hemi=None, colorbar=False, time_label='ms', w=None, h=None, axw=None, axh=None, foreground=None, background=None, parallel=True, cortex='classic', title=None, smoothing_steps=None, mask=True, subjects_dir=None, name=None, pos=None)[source]
Create a
Brainobject with a data layer- Parameters:
src (NDVar | SourceSpace | str) – Data to plot, with dimensions
([case,] source, [time]); can be specified asNDVarwith source-space data,SourceSpacedimension, or as subject name (str). Ifsrccontains aCasedimension, the average across cases is taken. If it contains integer data, it is plotted as annotation, otherwise as data layer.cmap (str | ndarray | dict) – Colormap (name of a matplotlib colormap) or LUT array. If
srcis an integer NDVar,cmapcan be a color dictionary mapping label IDs to colors.vmin (float) – Endpoints for the colormap. Need to be set explicitly if
cmapis a LUT array.vmax (float) – Endpoints for the colormap. Need to be set explicitly if
cmapis a LUT array.surf (Literal['inflated', 'pial', 'smoothwm', 'sphere', 'white']) – Freesurfer surface to use as brain geometry.
views (str | Sequence[str]) – One or several views to show in the figure. The options are:
'lateral', 'medial', 'ventral', 'dorsal', 'rostral', 'parietal', 'frontal', 'caudal'.hemi (Literal['lh', 'rh', 'both', 'split']) – Which hemispheres to plot (default based on data).
colorbar (bool) – Add a colorbar to the figure (use
.plot_colorbar()to plot a colorbar separately).time_label (str) – Label to show time point. Use
'ms'or's'to display time in milliseconds or in seconds, or supply a custom format string to format time values (in seconds; default is'ms').w (float) – Layout parameters (figure width/height, subplot width/height).
h (float) – Layout parameters (figure width/height, subplot width/height).
axw (float) – Layout parameters (figure width/height, subplot width/height).
axh (float) – Layout parameters (figure width/height, subplot width/height).
foreground (str | Sequence[float] | tuple[str, float]) – Figure foreground color (i.e., the text color).
background (str | Sequence[float] | tuple[str, float]) – Figure background color.
parallel (bool) – Set views to parallel projection (default
True).cortex (str | tuple | dict) – Mark gyri and sulci on the cortex. Presets:
'classic'(default),'high_contrast','low_contrast','bone'. Can also be a single color (e.g.'red',(0.1, 0.4, 1.)) or a tuple of two colors for gyri and sulci (e.g.['red', 'blue']or[(1, 0, 0), (0, 0, 1)]). For all options see the PySurfer documentation.title (str) – title for the window (default is based on the subject name and
src).smoothing_steps (int) – Number of smoothing steps if data is spatially undersampled (pysurfer
Brain.add_data()argument).mask (bool | str | Sequence[float] | tuple[str, float]) – Shade areas that are not in
src. Can be matplotlib color, including alpha (e.g.,(1, 1, 1, 0.5)for semi-transparent white). If smoothing is enabled throughsmoothing_steps, the mask is added as data layer, otherwise it is added as label. To add a mask independently, use theadd_mask()method.subjects_dir (Path | str) – Override the subjects_dir associated with the source space dimension.
name (str) – Equivalent to
title, for consistency with other plotting functions.pos (tuple[int, int]) – Position of the new window on the screen.
- Returns:
brain – Brain instance containing the plot.
- Return type: