visualizecell_morphology_visualizerget_3d_plot_morphology

get_3d_plot_morphology

visualize.cell_morphology_visualizer.get_3d_plot_morphology(lookup_table=None, colors='grey', color_keyword=None, synapses={}, time_point=None, highlight_section_kwargs={'sec_n': None, 'highlight_x': None, 'arrow_args': {}}, camera_position={'azim': 0, 'dist': 10, 'elev': 30, 'roll': 0}, dpi=72, population_to_color_dict={}, save='', plot=False, synapse_legend=True, legend=None, return_figax=True, proj_type='ortho')

Constructs a 3d matplotlib plot of a cell morphology, overlayed with some scalar data.

This is the main method called by CellMorphologyVisualizer to generate a 3D plot of the cell morphology. This method Uses LineCollections to plot the morphology, with a round joinstyle. This method is usually not called directly. Rather, CellMorphologyVisualizer calls this method to generate a plot, depending on parameters such as parallellization client, scalar data overlay, viewing angles etc… It is recommended to use the high-level method plot instead of trying to use this one directly.

Parameters:
  • lookup_table (pd.DataFrame) – pandas DataFrame with the morphology of the cell, where the initial point of each section is duplicated: once for the same section, and once as the last point of the previous section.

  • colors (str | array) – Color for the voltage. Either a single color for all sections, or a list of colors for each section.

  • color_keyword (str) – Keyword for the scalar data to be saved. Defaults to only diameter.

  • synapses (dict) – Dictionary with synapse activations. Keys are the population names, values are lists of synapse locations.

  • time_point (float) – Time point at which to plot the scalar data.

  • highlight_section_kwargs (dict) – Additional arguments for the arrow. See available kwargs on https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.patches.Arrow.html#matplotlib.patches.Arrow

  • camera_position (dict) – Camera angles and distance for matplotlib 3D visualizations. Possible keys: ‘azim’, ‘dist’, ‘elev’, ‘roll’

  • dpi (int) – Image quality. Default: 72

  • population_to_color_dict (dict) – Dictionary to map synapse group names (str) to colors. Must contain the same keys as synapses.keys()

  • save (str) – Path where the plot will be saved. If it’s empty it will not be saved (Default)

  • plot (bool) – whether to show the plot. Default: False

  • synapse_legend (bool) – Whether the synapse activations legend should appear in the plot

  • legend (bool) – Whether the legend for scalar data (e.g. membrane voltage) should appear in the plot

  • return_figax (bool) – Whether to return the figure and axis objects. Default: True

  • proj_type (str) – Projection type for the 3D plot. Default: “ortho”

Returns:

fig and ax object if return_figax is True. None otherwise.

Return type:

tuple | None