eelbrain.plot.GlassBrain.butterfly
- classmethod GlassBrain.butterfly(y, cmap=None, vmin=None, vmax=None, dest='mri', mri_resolution=False, mni305=None, black_bg=False, display_mode=None, threshold=None, colorbar=False, alpha=0.7, plot_abs=False, draw_arrows=True, symmetric_cbar='auto', interpolation='nearest', w=5, h=2.5, xlim=None, name=None, **kwargs)
Shortcut for a butterfly-plot with a time-linked glassbrain plot
- Parameters
y (NDVar ([case,] time, source[, space])) – Data to plot; if
ndvar
has a case dimension, the mean is plotted. ifndvar
has a space dimension, the norm is plotted.cmap (str) – Colormap (name of a matplotlib colormap).
vmin (scalar) – Plot data range minimum.
vmax (scalar) – Plot data range maximum.
dest ('mri' | 'surf') – If ‘mri’ the volume is defined in the coordinate system of the original T1 image. If ‘surf’ the coordinate system of the FreeSurfer surface is used (Surface RAS).
mri_resolution (bool, Default is False) – If True the image will be created in MRI resolution. WARNING: it can result in significantly high memory usage.
mni305 (bool) – Project data from MNI-305 space to MNI-152 space (by default this is enabled iff the source space subject is
fsaverage
).black_bg (boolean) – If True, the background of the image is set to be black.
display_mode (str) –
Direction of the cuts:
'x'
: sagittal'y'
: coronal'z'
: axial'l'
: sagittal, left hemisphere only'r'
: sagittal, right hemisphere only'ortho'
: three cuts in orthogonal directions, equivalent to'yxz'
Possible values are: ‘ortho’, ‘x’, ‘y’, ‘z’, ‘xz’, ‘yx’, ‘yz’, ‘l’, ‘r’, ‘lr’, ‘lzr’, ‘lyr’, ‘lzry’, ‘lyrz’. Default depends on hemispheres in data.
threshold (scalar | 'auto') – If a number is given, values below the threshold (in absolute value) are plotted as transparent. If
'auto'
is given, the threshold is determined magically by analysis of the image.colorbar (boolean, Default is False) – If True, display a colorbar on the right of the plots.
alpha (float between 0 and 1) – Alpha transparency for the brain schematics
plot_abs (bool) – Plot the maximum intensity projection of the absolute value (rendering positive and negative values in the same manner). By default, (
False
), the sign of the maximum intensity will be represented with different colors. See examples. Only affects GlassBrain plot.draw_arrows (boolean) – Draw arrows in the direction of activation over the glassbrain plots. Naturally, for this to work
ndvar
needs to contain space dimension (i.e 3D vectors). By default it is set toTrue
.symmetric_cbar (boolean or 'auto') – Specifies whether the colorbar should range from -vmax to vmax or from vmin to vmax. Setting to ‘auto’ will select the latter if the range of the whole image is either positive or negative. Note: The colormap will always be set to range from -vmax to vmax.
interpolation (str) – Interpolation to use when resampling the image to the destination space. Can be “continuous” (default) to use 3rd-order spline interpolation, or “nearest” to use nearest-neighbor mapping. “nearest” is faster but can be noisier in some cases.
w (scalar) – Butterfly plot width (inches).
h (scalar) – Plot height (inches; applies to butterfly and brain plot).
xlim (scalar | (scalar, scalar)) – Initial x-axis view limits as
(left, right)
tuple or aslength
scalar (default is the full x-axis in the data).name (str) – The window title (default is ndvar.name).
- Returns
butterfly_plot (plot.Butterfly) – Butterfly plot.
glassbrain (GlassBrain) – GlassBrain plot.