braincell.vis.plot_movie#
- braincell.vis.plot_movie(morpho, values_over_time, *, dt=None, dimensionality='2d', out=None, fps=30, cmap='viridis', vmin=None, vmax=None, value_label=None, layout=None, shape=None, layout_config=None, mode=None, ax=None, figsize=None)[source]#
Render a time-varying colour-by-values animation over a morphology.
- Parameters:
morpho (
Morphology) – Morphology the values are defined against.values_over_time (ArrayLike) – A
(T, N)array whereTis the number of frames andNmatches one of the supported shapes forValueSpec(n_branches, total segment count, or total centerline-point count). Units attached viabrainunitare stripped and used as the default colour-bar label.dt (Quantity or None) – Optional timestep between frames. Only used to display the current time in the figure title.
dimensionality (
str) – Target backend. 2D uses matplotlibFuncAnimation; 3D uses PyVista’s movie writer.out (
Path|str|None) – If set, the animation is written to this path (.mp4/.giffor 2D,.mp4for 3D). The directory must already exist.fps (
int) – Frames per second for the output file.cmap (
str) – Forwarded toValueSpecand applied uniformly across every frame.vmin (
float|None) – Forwarded toValueSpecand applied uniformly across every frame.vmax (
float|None) – Forwarded toValueSpecand applied uniformly across every frame.value_label (
str|None) – Forwarded toValueSpecand applied uniformly across every frame.layout (
str|None) – Layout / rendering knobs forwarded to the scene builder. Match the semantics ofplot2d()/plot3d().shape (
str|None) – Layout / rendering knobs forwarded to the scene builder. Match the semantics ofplot2d()/plot3d().layout_config (
LayoutConfig|None) – Layout / rendering knobs forwarded to the scene builder. Match the semantics ofplot2d()/plot3d().mode (
str|None) – Layout / rendering knobs forwarded to the scene builder. Match the semantics ofplot2d()/plot3d().ax (matplotlib Axes or None) – Optional Axes to render into. Ignored in 3D mode.
figsize (
tuple[float,float] |None) – Matplotlib figure size. Ignored when ax is supplied.
- Returns:
The underlying animation / plotter, frame count, and output path (if any).
- Return type:
MovieResult- Raises:
ValueError – If values_over_time is not 2-D or if the frame count is zero.