plot3d

Contents

plot3d#

class braintools.visualize.morphology.plot3d(morpho, *, region=None, locset=None, values=None, cmap=None, vmin=None, vmax=None, norm=None, value_label=None, show_colorbar=True, mode=None, backend=None, chooser=None, notebook=None, jupyter_backend=None, return_plotter=False, hooks=None)[source]#

Render a morphology in 3-D with PyVista or Plotly.

Every branch must carry point geometry (MorphologyData.has_full_point_geometry).

Parameters:
  • morpho (MorphologyData-like) – A MorphologyData or any object implementing __morphology_data__().

  • region – Overlays and colour mapping, as in plot2d().

  • locset – Overlays and colour mapping, as in plot2d().

  • values – Overlays and colour mapping, as in plot2d().

  • cmap (str | None) – Overlays and colour mapping, as in plot2d().

  • vmin (float | None) – Overlays and colour mapping, as in plot2d().

  • vmax (float | None) – Overlays and colour mapping, as in plot2d().

  • norm – Overlays and colour mapping, as in plot2d().

  • value_label (str | None) – Overlays and colour mapping, as in plot2d().

  • show_colorbar (bool) – Overlays and colour mapping, as in plot2d().

  • mode (str | None) – Tubes with the branch radii, or thin centerlines. Defaults to VisDefaults.mode_3d_default.

  • backend (str | None) – Defaults to the first one installed.

  • chooser (BackendChooser | None) – Explicit backend chooser.

  • notebook (bool | None) – Embed the scene in the notebook cell output.

  • jupyter_backend (str | None) – PyVista Jupyter backend, such as "html" for static documents.

  • return_plotter (bool) – Return the PyVista plotter or Plotly figure instead of showing it.

  • hooks (VisHooks | None) – Pick callbacks.

Returns:

The backend’s plotter or figure.

Return type:

object

Raises:
  • ValueError – If some branch lacks point geometry or mode is not recognised.

  • RuntimeError – If neither PyVista nor Plotly is installed (pip install braintools[morphology]).

See also

plot2d

2-D drawing with Matplotlib.

braintools.visualize.dendrite_tree_3d

Plotly tree of explicit coordinates.

Examples

>>> from braintools.visualize.morphology import plot3d
>>> plotter = plot3d(data, mode="skeleton", return_plotter=True)