jaxley.morphology.morph_connect

Navigation

jaxley.morphology.morph_connect#

morph_connect(module_view1, module_view2)[source]#

Combine two morphologies into a single cell.

Both morphologies must have the same number of compartments per branch in all branches.

This function deletes all existing recordings, stimuli, and trainable parameters.

Parameters:
  • module_view1 – View of a jx.Cell(). Must have been created with a command ending on loc(0.0) or loc(1.0). For example, the following are valid: cell.branch(0).loc(0.0), cell.branch(5).loc(0.0), cell.branch(5).loc(1.0). But those are not valid: cell.branch(0).comp(0) (uses .comp), cell.branch(5).loc(0.9) (does not use loc(0.0) or loc(1.0)).

  • module_view2 – The view of a jx.Cell(). Must follow the same rules as module_view1.

Returns:

A jx.Cell which is made up of both input cells.

Return type:

Cell

Example usage#

cell = jx.read_swc("path_to_swc_file.swc", ncomp=1)
stub = jx.Cell()
cell = morph_connect(cell.branch(0).loc(0.0), stub.branch(0).loc(0.0))