fastplotlib.ImageVolumeGraphic#

class ImageVolumeGraphic(data, mode='mip', vmin=None, vmax=None, cmap='plasma', interpolation='linear', cmap_interpolation='linear', plane=(0, 0, -1, 0), threshold=0.5, step_size=1.0, substep_size=0.1, emissive=(0, 0, 0), shininess=30, isolated_buffer=True, **kwargs)[source]#

Create an ImageVolumeGraphic.

Parameters:
  • data (array-like) – array-like, usually numpy.ndarray, must support memoryview(). Shape must be [n_planes, n_rows, n_cols] for grayscale, or [n_planes, n_rows, n_cols, 3 | 4] for RGB(A)

  • mode (str, default "mip") – render mode, one of “mip”, “minip”, “iso” or “slice”

  • vmin (float) – lower contrast limit

  • vmax (float) – upper contrast limit

  • cmap (str, default "plasma") – colormap for grayscale volumes

  • interpolation (str, default "linear") – interpolation method for sampling pixels

  • cmap_interpolation (str, default "linear") – interpolation method for sampling from colormap

  • plane ((float, float, float, float), default (0, 0, -1, 0)) – Slice volume at this plane. Sets (a, b, c, d) in the equation the defines a plane: ax + by + cz + d = 0. Used only if mode = “slice”

  • threshold (float, default 0.5) – The threshold texture value at which the surface is rendered. Used only if mode = “iso”

  • step_size (float, default 1.0) – The size of the initial ray marching step for the initial surface finding. Smaller values will result in more accurate surfaces but slower rendering. Used only if mode = “iso”

  • substep_size (float, default 0.1) – The size of the raymarching step for the refined surface finding. Smaller values will result in more accurate surfaces but slower rendering. Used only if mode = “iso”

  • emissive (Color, default (0, 0, 0, 1)) – The emissive color of the surface. I.e. the color that the object emits even when not lit by a light source. This color is added to the final color and unaffected by lighting. The alpha channel is ignored. Used only if mode = “iso”

  • shininess (int, default 30) – How shiny the specular highlight is; a higher value gives a sharper highlight. Used only if mode = “iso”

  • isolated_buffer (bool, default True) – If True, initialize a buffer with the same shape as the input data and then set the data, useful if the data arrays are ready-only such as memmaps. If False, the input array is itself used as the buffer - useful if the array is large.

  • kwargs – additional keyword arguments passed to Graphic

Examples#

Volume movie

Volume movie

Multi channel volumes

Multi channel volumes

Volume non-orthogonal slicing

Volume non-orthogonal slicing

Volume modes

Volume modes

Volume share buffers

Volume share buffers

Volume non-orthogonal slicing animation

Volume non-orthogonal slicing animation