visbrain.objects.Picture3DObj

class visbrain.objects.Picture3DObj(name, data, xyz, select=None, pic_width=7.0, pic_height=7.0, alpha=1.0, cmap='viridis', clim=None, vmin=None, vmax=None, under='gray', over='red', translate=(0.0, 0.0, 1.0), transform=None, parent=None, verbose=None, _z=-10.0, **kw)[source][source]

Create a 3-D picture object.

Parameters:
namestring

The name of the connectivity object.

dataarray_like

Array of data pictures of shape (n_sources, n_rows, n_columns).

xyzarray_like

The 3-d position of each picture of shape (n_sources, 3).

selectarray_like | None

Select the pictures to display. Should be a vector of bolean values of shape (n_sources,).

pic_widthfloat | 7.

Width of each picture.

pic_heightfloat | 7.

Height of each picture.

alphafloat | 1.

Image transparency.

cmapstring | ‘viridis’

Colormap to use.

vminfloat | None

Lower threshold of the colormap.

understring | None

Color to use for values under vmin.

vminfloat | None

Higher threshold of the colormap.

overstring | None

Color to use for values over vmax.

translatetuple | (0., 0., 1.)

Translation over the (x, y, z) axis.

transformVisPy.visuals.transforms | None

VisPy transformation to set to the parent node.

parentVisPy.parent | None

Line object parent.

verbosestring

Verbosity level.

_zfloat | 10.

In case of (n_sources, 2) use _z to specify the elevation.

kwdict | {}

Optional arguments are used to control the colorbar (See ColorbarObj).

Notes

List of supported shortcuts :

  • s : save the figure

  • <delete> : reset camera

Examples

>>> import numpy as np
>>> from visbrain.objects import Picture3DObj
>>> n_rows, n_cols, n_pic = 10, 20, 5
>>> data = np.random.rand(n_pic, n_rows, n_cols)
>>> xyz = np.random.uniform(-10, 10, (n_pic, 3))
>>> pic = Picture3DObj('Pic', data, xyz, cmap='plasma')
>>> pic.preview(axis=True)

Methods

__init__(name, data, xyz[, select, ...])

Init.

animate([step, interval, iterations])

Animate the object.

copy()

Get a copy of the object.

describe_tree()

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_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()

Update image.

update_from_dict(kwargs)

Update attributes from a dictionary.

Examples using visbrain.objects.Picture3DObj

Combine multiple objects

Combine multiple objects

Time-series and pictures 3D (TimeSeries3DObj & Picture3DObj): complete tutorial

Time-series and pictures 3D (TimeSeries3DObj & Picture3DObj): complete tutorial

Add pictures

Add pictures