tfmri.plot.image_sequence

image_sequence(images, part=None, cmap='gray', norm=None, fps=20.0, fig_size=None, dpi=None, bg_color='dimgray', layout=None, bbox_inches=None, pad_inches=0.1, fig_title=None)[source]

Plots a sequence of images.

Parameters
  • images

    A 3D np.ndarray of shape [time, height, width] (scalar values, mapped to colors using cmap) or a 4D np.ndarray of shape [time, height, width, 3] (RGB) or [time, height, width, 4] (RGBA).

  • part – An optional str. The part to display for complex numbers. One of 'abs', 'angle', 'real' or 'imag'. Must be specified if images has complex dtype.

  • cmap

    A str or matplotlib.colors.Colormap. The colormap used to map scalar values to colors. This parameter is ignored for RGB(A) data. Defaults to 'gray'.

  • norm – A matplotlib.colors.Normalize. Used to scale scalar data to the [0, 1] range before mapping to colors using cmap. By default, a linear scaling mapping the lowest value to 0 and the highest to 1 is used. This parameter is ignored for RGB(A) data.

  • fps – A float. The number of frames per second. Defaults to 20.

  • fig_size

    A tuple of floats. Width and height of the figure in inches.

  • dpi

    A float. The resolution of the figure in dots per inch.

  • bg_color – A color. The background color.

  • layout

    A str. One of None, 'tight' (default) or 'constrained'. The layout mechanism. See matplotlib.figure.Figure for details.

  • bbox_inches

    A str or matplotlib.transforms.Bbox. Bounding box in inches: only the given portion of the figure is displayed. If 'tight', try to figure out the tight bbox of the figure.

  • pad_inches

    A float. Amount of padding around the figure when bbox_inches is 'tight'. Defaults to 0.1.

  • fig_title

    A str. The title of the figure.

Returns

A matplotlib.animation.ArtistAnimation object.