eelbrain.plot._brain_object.Brain
- 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)[source]
PySurfer
surfer.Brainsubclass returned byplot.brainfunctionsPySurfer
surfer.Brainsubclass adding Eelbrain GUI integration and methods to visualize data inNDVarformat.- Parameters:
subject (str) – Subject name.
hemi (Literal['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.
Specifies how the cortical surface is rendered. Options:
The name of one of the preset cortex styles:
'classic'(default),'high_contrast','low_contrast', or'bone'.A color-like argument to render the cortex as a single color, e.g.
'red'or(0.1, 0.4, 1.). Setting this toNoneis equivalent to(0.5, 0.5, 0.5).The name of a colormap used to render binarized curvature values, e.g.,
Grays.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)].
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).A dict of keyword arguments that is passed on to the call to surface.
alpha (float) – Alpha level to control opacity of the cortical surface (
0 <= alpha <= 1).background (ColorArg) – color of the background and foreground of the display window
foreground (ColorArg) – color of the background and foreground of the display window
subjects_dir (PathArg) – If not None, this directory will be used as the subjects directory instead of the value set using the SUBJECTS_DIR environment variable.
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 (float) – Figure width and height.
h (float) – Figure width and height.
axw (float) – Width and height of the individual viewing panes.
axh (float) – Width and height of the individual viewing panes.
name (str) – Window title (alternative to
titlefor consistency with other Eelbrain figures).pos (tuple[int, 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).
source_space (SourceSpace)
Notes
The documentation lists only the methods that Eelbrain adds to or overrides from the PySurfer
Brainsuper-class. For complete PySurfer functionality see te PySurfer documentation.Initializing a
Brainobject is expensive. When plotting multiple overlays on the same brain, it is more economical to initialize only oneBrainobject and adding/removing the data layers in a loop. Pseudo-code for an example adding images to a table:table = fmtxt.Table('ll') b = brain(source_space, hemi=hemi, …) for data_layer in data_layers: table.cell(data_layer.name) b.add_ndvar(data_layer, ...) im = b.image() table.cell(im) b.remove_data() b.remove_labels()For another example see the implementation of
SequencePlotter.
Methods
|
|
|
Add a mask shading areas that are not included in an NDVar |
|
Add data layer form an NDVar |
|
Add annotation from labels in an NDVar |
|
Draw a boolean NDVar as label. |
|
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 |
|
|
|
Create an FMText Image from a screenshot |
|
Link the time axis of this figure with another figure |
|
Play an animation by setting time |
|
Plot a colorbar corresponding to the displayed data |
|
Plot legend for parcellation |
|
Remove data shown with |
|
Remove labels shown with |
|
Save view from all panels to disk |
|
Set view to parallel projection |
|
Set image size in pixels |
|
|
|
Set the time point to display |
|
Set the window title |
|
Change the colormap limits |