jaxley.read_swc

Navigation

jaxley.read_swc#

read_swc(fname, ncomp, max_branch_len=None, min_radius=None, assign_groups=True, backend='graph', ignore_swc_tracing_interruptions=True, relevant_type_ids=None)[source]#

Reads SWC file into a Cell.

Jaxley assumes cylindrical compartments and therefore defines length and radius for every compartment. The surface area is then 2*pi*r*length. For branches consisting of a single traced point we assume for them to have area 4*pi*r*r. Therefore, in these cases, we set lenght=2*r.

Parameters:
  • fname (str) – Path to the swc file.

  • ncomp (int | None) – The number of compartments per branch.

  • max_branch_len (float | None) – If a branch is longer than this value it is split into two branches.

  • min_radius (float | None) – If the radius of a reconstruction is below this value it is clipped.

  • assign_groups (bool) – If True, then the identity of reconstructed points in the SWC file will be used to generate groups soma, axon, basal, apical. See here: http://www.neuronland.org/NLMorphologyConverter/MorphologyFormats/SWC/Spec.html

  • backend (str) – The backend to use. Currently only graph is supported.

  • ignore_swc_tracing_interruptions (bool) – Whether to ignore discontinuities in the swc tracing order. If False, this will result in split branches at these points.

  • relevant_type_ids (List[int] | None) – All type ids that are not in this list will be ignored for tracing the morphology. This means that branches which have multiple type ids (which are not in relevant_type_ids) will be considered as one branch. If None, we default to [1, 2, 3, 4].

Returns:

A Cell object.

Return type:

Cell