braincell.vis module#
braincell.vis is the visualization layer of BrainCell. It turns a
Morphology (or any higher-level object that carries
one) into static plots through matplotlib, interactive 3D through PyVista
or Plotly, and publication-quality exports. The module is deliberately
split into three layers:
Scene builders (
scene2d/scene3d) translate a morphology plus an overlay spec into backend-agnostic primitive tuples.Backends (
backend_matplotlib,backend_pyvista,backend_plotly) render those primitives. Each backend advertises its supported scene kinds via a capability set.High-level entry points (
plot2d,plot3d,plot_movie,plot_traces, morphometry plots) are the user-facing surface.
Optional dependencies (matplotlib, pyvista, plotly) are
imported lazily inside the backend that uses them so the base install
stays small.
Top-level plot entry points#
Render a time-varying colour-by-values animation over a morphology. |
|
Plot time-series traces at selected morphology locations. |
Morphometry and topology plots#
Render a left-to-right dendrogram of the morphology. |
|
Render a topology-only schematic (length-ignored) of the morphology. |
|
Render a |
|
Plot a Sholl-intersection curve. |
|
Bar chart of the number of branches per branch order. |
Comparison helpers#
Render several morphologies side by side with a shared layout. |
|
Render the same morphology with multiple value overlays. |
Interactivity hooks#
Styling, themes and configuration#
Temporarily override visualization defaults for the duration of a block. |
|
Activate the |
|
Save a vis backend return value to disk. |
Publication-quality styling preset for |
Scene primitives and overlays#
User-facing overlay request passed through |
|
Styling parameters for a color-by-values overlay. |
Layout engine#
Configurable parameters for the 2D layout engine. |
|
Size-bounded LRU cache for layout-branch builder results. |
Publication constants#
- braincell.vis.PUBLICATION_BRANCH_TYPE_COLORS#
Publication-ready branch-type colour palette (RGB tuples keyed by branch type). High-contrast, print-friendly, and colour-blind safe; mirrors the keys of the default palette so the two presets can be diffed side by side.
- braincell.vis.PUBLICATION_RC_PARAMS#
Matplotlib
rcParamsapplied when the publication theme is active. Tuned for LaTeX-style output (serif font, thicker lines, no grid, tight margins) and 300 dpi raster export.