visbrain.objects.TopoObj¶
- class visbrain.objects.TopoObj(name, data, xyz=None, channels=None, system='cartesian', levels=None, level_colors='white', unit='degree', line_color='black', line_width=3.0, chan_size=12.0, chan_offset=(0.0, 0.0, 0.0), chan_mark_color='white', chan_mark_symbol='disc', chan_txt_color='black', cmap='viridis', clim=None, vmin=None, under='gray', vmax=None, over='red', margin=0.05, transform=None, parent=None, verbose=None, **kw)[source][source]¶
Create a topoplot object.
- Parameters:
- namestring
The name of the connectivity object.
- dataarray_like
Array of data of shape (n_channels)
- xyzarray_like | None
Array of source’s coordinates.
- channelslist | None
List of channel names.
- system{‘cartesian’, ‘spherical’}
Coordinate system.
- levelsarray_like/int | None
The levels at which the isocurve is constructed.
- level_colorsstring/array_like | ‘white’
The color to use when drawing the line. If a list is given, it must be of shape (Nlev), if an array is given, it must be of shape (Nlev, …). and provide one color per level (rgba, colorname). By default, all levels are whites.
- unit{‘degree’, ‘rad’}
If system is ‘spherical’, specify if angles are in degrees or radians.
- line_colorarray_like/string | ‘black’
Color of lines for the head, nose and eras.
- line_widthfloat | 4.
Line width for the head, nose and eras.
- chan_sizefloat | 12.
Size of channel names text.
- chan_mark_colorarray_like/string | ‘white’
Color of channel markers.
- chan_mark_symbolstring | ‘disc’
Symbol to use for markers. Use disc, arrow, ring, clobber, square, diamond, vbar, hbar, cross, tailed_arrow, x, triangle_up, triangle_down, and star.
- chan_txt_colorarray_like/string | ‘black’
Color of channel names.
- cmapstring | None
Matplotlib colormap (like ‘viridis’, ‘inferno’…).
- climtuple/list | None
Colorbar limit. Every values under / over clim will clip.
- vminfloat | None
Every values under vmin will have the color defined using the under parameter.
- vmaxfloat | None
Every values over vmin will have the color defined using the over parameter.
- undertuple/string | None
Matplotlib color under vmin.
- overtuple/string | None
Matplotlib color over vmax.
- transformVisPy.visuals.transforms | None
VisPy transformation to set to the parent node.
- parentVisPy.parent | None
Line object parent.
- verbosestring
Verbosity level.
- kwdict | {}
Optional arguments are used to control the colorbar (See
ColorbarObj
).
Notes
List of supported shortcuts :
s : save the figure
<delete> : reset camera
Methods
__init__
(name, data[, xyz, channels, ...])Init.
animate
([step, interval, iterations])Animate the object.
connect
(connect, **kwargs)Draw connectivity lines between channels.
copy
()Get a copy of the object.
Tree description.
preview
([bgcolor, axis, xyz, show, obj, ...])Previsualize the result.
record_animation
(name[, n_pic, bgcolor])Record an animated object and save as a *.gif file.
render
()Render the canvas.
screenshot
(saveas[, print_size, dpi, unit, ...])Take a screeshot of the scene.
set_data
(data[, levels, level_colors, cmap, ...])Set data to the topoplot.
set_shortcuts_to_canvas
(canvas)Set shortcuts to a VisbrainCanvas.
to_dict
()Return a dictionary of all colorbar args.
to_kwargs
([addisminmax])Return a dictionary for input arguments.
update
()Fonction to run when an update is needed.
update_from_dict
(kwargs)Update attributes from a dictionary.