mne.viz.plot_volume_source_estimates#
- mne.viz.plot_volume_source_estimates(stc, src, subject=None, subjects_dir=None, mode='stat_map', bg_img='T1.mgz', colorbar=True, colormap='auto', clim='auto', transparent=None, show=True, initial_time=None, initial_pos=None, verbose=None)[source]#
Plot Nutmeg style volumetric source estimates using nilearn.
- Parameters:
- stc
VectorSourceEstimate
The vector source estimate to plot.
- srcinstance of
SourceSpaces
| instance ofSourceMorph
The source space. Can also be a SourceMorph to morph the STC to a new subject (see Examples).
Changed in version 0.18: Support for
SpatialImage
.- subject
str
|None
The FreeSurfer subject name. If
None
,stc.subject
will be used.- subjects_dirpath-like |
None
The path to the directory containing the FreeSurfer subjects reconstructions. If
None
, defaults to theSUBJECTS_DIR
environment variable.- mode
str
The plotting mode to use. Either ‘stat_map’ (default) or ‘glass_brain’. For “glass_brain”, activation absolute values are displayed after being transformed to a standard MNI brain.
- bg_imginstance of
SpatialImage
|str
The background image used in the nilearn plotting function. Can also be a string to use the
bg_img
file in the subject’s MRI directory (default is'T1.mgz'
). Not used in “glass brain” plotting.- colorbar
bool
, optional If True, display a colorbar on the right of the plots.
- colormap
str
|np.ndarray
offloat
, 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.
- clim
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 bounds for colormap.
pos_lims
list | np.ndarray | tuple of float, 3 elementsLower, middle, and upper bound for colormap. Positive values will be mirrored directly across zero during colormap construction to obtain negative control points.
Note
Only one of
lims
orpos_lims
should be provided. Only sequential colormaps should be used withlims
, and only divergent colormaps should be used withpos_lims
.- transparent
bool
|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.
- show
bool
Show figures if True. Defaults to True.
- initial_time
float
|None
The initial time to plot. Can be None (default) to use the time point with the maximal absolute value activation across all voxels or the
initial_pos
voxel (ifinitial_pos is None
or not, respectively).New in version 0.19.
- initial_pos
ndarray
, shape (3,) |None
The initial position to use (in m). Can be None (default) to use the voxel with the maximum absolute value activation across all time points or at
initial_time
(ifinitial_time is None
or not, respectively).New in version 0.19.
- verbose
bool
|str
|int
|None
Control verbosity of the logging output. If
None
, use the default verbosity level. See the logging documentation andmne.verbose()
for details. Should only be passed as a keyword argument.
- stc
- Returns:
- figinstance of
Figure
The figure.
- figinstance of
Notes
Click on any of the anatomical slices to explore the time series. Clicking on any time point will bring up the corresponding anatomical map.
The left and right arrow keys can be used to navigate in time. To move in time by larger steps, use shift+left and shift+right.
In
'glass_brain'
mode, values are transformed to the standard MNI brain using the FreeSurfer Talairach transformation$SUBJECTS_DIR/$SUBJECT/mri/transforms/talairach.xfm
.New in version 0.17.
Changed in version 0.19: MRI volumes are automatically transformed to MNI space in
'glass_brain'
mode.Examples
Passing a
mne.SourceMorph
as thesrc
parameter can be useful for plotting in a different subject’s space (here, a'sample'
STC in'fsaverage'
’s space):>>> morph = mne.compute_source_morph(src_sample, subject_to='fsaverage') >>> fig = stc_vol_sample.plot(morph)