single_cell_parseranalyzesynanalysiscompute_distance_to_soma

compute_distance_to_soma

single_cell_parser.analyze.synanalysis.compute_distance_to_soma(sec, x, cell=None, consider_gap_to_soma=False)

Computes the distance from a point to the soma.

The point for which to compute the distance is defined by a section and a relative point on that section (the x coordinate between 0 and 1).

Used in compute_syn_distance() and compute_syn_distances().

Parameters:
  • sec (single_cell_parser.cell.PySection | int) – Section or section ID of the cell. If the section ID is given, cell must be provided.

  • x (float) – Relative point on section, from 0 to 1.

  • cell (single_cell_parser.cell.Cell, optional) – Only required if sec is the section ID.

  • consider_gap_to_soma (bool, optional) – Accounts for the fact that dendrites don’t actually touch the soma, and adds the distance between the last point of the parent section and the first point of the current section to the distance. Default: False

Returns:

distance to the soma

Return type:

float