Plot VectorSourceEstimate with PyVista.
A “glass brain” is drawn and all dipoles defined in the source estimate are shown using arrows, depicting the direction and magnitude of the current moment at the dipole. Additionally, an overlay is plotted on top of the cortex with the magnitude of the current.
VectorSourceEstimate
| MixedVectorSourceEstimate
The vector source estimate to plot.
str
| None
The FreeSurfer subject name.
If None
, stc.subject
will be used.
str
, ‘lh’ | ‘rh’ | ‘split’ | ‘both’The hemisphere to display.
str
| np.ndarray
of float
, shape(n_colors, 3 | 4)Name of colormap to use or a custom look up table. If array, must be (n x 3) or (n x 4) array for with RGB or RGBA values between 0 and 255. This should be a sequential colormap.
str
| callable()
| None
Format of the time label (a format string, a function that maps
floating point time values to strings, or None for no label). The
default is 'auto'
, which will use time=%0.2f ms
if there
is more than one time point.
int
The amount of smoothing.
None
If True: use a linear transparency between fmin and fmid and make values below fmin fully transparent (symmetrically for divergent colormaps). None will choose automatically based on colormap type.
float
Alpha value to apply globally to the surface meshes. Defaults to 0.4.
float
Alpha value to apply globally to the overlay. Defaults to
brain_alpha
.
float
Alpha value to apply globally to the vector glyphs. Defaults to 1.
float
| None
Scaling factor for the vector glyphs. By default, an attempt is made to automatically determine a sane value.
str
Display time viewer GUI. Can be “auto”, which is True for the PyVista backend and False otherwise.
Changed in version 0.20: Added “auto” option and default.
str
The path to the freesurfer subjects reconstructions. It corresponds to Freesurfer environment variable SUBJECTS_DIR.
Figure3D
| list
| int
| None
If None, a new figure will be created. If multiple views or a split view is requested, this must be a list of the appropriate length. If int is provided it will be used to identify the PyVista figure by it’s id or create a new figure with the given id.
str
| list
View to use. Using multiple views (list) is not supported for mpl
backend. See Brain.show_view
for
valid string options.
If True, display colorbar on scene.
str
| dict
Colorbar properties specification. If ‘auto’, set clim automatically based on data percentiles. If dict, should contain:
kind
‘value’ | ‘percent’Flag to specify type of limits.
lims
list | np.ndarray | tuple of float, 3 elementsLower, middle, and upper bound for colormap.
Unlike stc.plot
, it cannot use
pos_lims
, as the surface plot must show the magnitude.
str
or tuple
Specifies how binarized curvature values are rendered. either the name of a preset Brain cortex colorscheme (one of ‘classic’, ‘bone’, ‘low_contrast’, or ‘high_contrast’), or the name of a colormap, or a tuple with values (colormap, min, max, reverse) to fully specify the curvature colors.
float
or tuple
of float
The size of the window, in pixels. can be one number to specify a square window, or the (width, height) of a rectangular window.
Color of the background of the display window.
None
Color of the foreground of the display window. None will choose black or white based on the background color.
float
| None
The time to display on the plot initially. None
to display the
first time sample (default).
Whether time is represented in seconds (“s”, default) or milliseconds (“ms”).
str
| float
If True, enable interactive picking of a point on the surface of the
brain and plot its time course.
This feature is only available with the PyVista 3d backend, and requires
time_viewer=True
. Defaults to ‘auto’, which will use True if and
only if time_viewer=True
, the backend is PyVista, and there is more
than one time point. If float (between zero and one), it specifies what
proportion of the total window should be devoted to traces (True is
equivalent to 0.25, i.e., it will occupy the bottom 1/4 of the figure).
New in version 0.20.0.
SourceSpaces
| None
The source space corresponding to the source estimate. Only necessary if the STC is a volume or mixed source estimate.
float
| dict
| None
Options for volumetric source estimate plotting, with key/value pairs:
'resolution'
float | NoneResolution (in mm) of volume rendering. Smaller (e.g., 1.) looks better at the cost of speed. None (default) uses the volume source space resolution, which is often something like 7 or 5 mm, without resampling.
'blending'
strCan be “mip” (default) for maximum intensity projection or “composite” for composite blending using alpha values.
'alpha'
float | NoneAlpha for the volumetric rendering. Defaults are 0.4 for vector source estimates and 1.0 for scalar source estimates.
'surface_alpha'
float | NoneAlpha for the surface enclosing the volume(s). None (default) will use half the volume alpha. Set to zero to avoid plotting the surface.
'silhouette_alpha'
float | NoneAlpha for a silhouette along the outside of the volume. None (default)
will use 0.25 * surface_alpha
.
'silhouette_linewidth'
floatThe line width to use for the silhouette. Default is 2.
A float input (default 1.) or None will be used for the 'resolution'
entry.
str
Can be “vertical” (default) or “horizontal”. When using “horizontal” mode, the PyVista backend must be used and hemi cannot be “split”.
dict
| None
Additional arguments to brain.add_data (e.g.,
dict(time_label_size=10)
).
dict
| None
Additional arguments to the mne.viz.Brain
constructor (e.g.,
dict(silhouette=True)
).
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
mne.viz.Brain
A instance of mne.viz.Brain
.
Notes
New in version 0.15.
If the current magnitude overlay is not desired, set overlay_alpha=0
and smoothing_steps=1
.
mne.viz.plot_vector_source_estimates
#Plotting the full vector-valued MNE solution