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
MorphologyDataor 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 inplot2d().vmin (
float|None) – Overlays and colour mapping, as inplot2d().vmax (
float|None) – Overlays and colour mapping, as inplot2d().norm – Overlays and colour mapping, as in
plot2d().value_label (
str|None) – Overlays and colour mapping, as inplot2d().show_colorbar (
bool) – Overlays and colour mapping, as inplot2d().mode (
str|None) – Tubes with the branch radii, or thin centerlines. Defaults toVisDefaults.mode_3d_default.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.
- Returns:
The backend’s plotter or figure.
- Return type:
- Raises:
ValueError – If some branch lacks point geometry or
modeis not recognised.RuntimeError – If neither PyVista nor Plotly is installed (
pip install braintools[morphology]).
See also
plot2d2-D drawing with Matplotlib.
braintools.visualize.dendrite_tree_3dPlotly tree of explicit coordinates.
Examples
>>> from braintools.visualize.morphology import plot3d >>> plotter = plot3d(data, mode="skeleton", return_plotter=True)