morph_tool.graft

Grafting is the process of taking one piece of a neuron and putting it on another neuron.

Functions

delete_old_axons(neuron)

Delete all axons.

find_axon(axon_or_donor_axon)

Find the root section which is an axon.

graft_axon(neuron, axon_or_donor_neuron[, rng])

Graft an axon.

grafting_position(neuron, axon_or_donor_neuron)

Find out where to put the grafted axon.

morph_tool.graft.delete_old_axons(neuron)

Delete all axons.

morph_tool.graft.find_axon(axon_or_donor_axon)

Find the root section which is an axon.

If the number of axons found is greater than 1, then return the first axon.

morph_tool.graft.graft_axon(neuron, axon_or_donor_neuron, rng=<module 'numpy.random' from '/home/docs/checkouts/readthedocs.org/user_builds/morph-tool/envs/latest/lib/python3.8/site-packages/numpy/random/__init__.py'>)

Graft an axon.

This is a very simple implementation. No check are performed and the new axon is simply translated at the place where the old axon was.

Parameters
  • neuron (morphio.mut.Morphology) – Neuron where the axon will be grafted

  • axon_or_donor_neuron (morphio.Morphology) – An axon or a neuron with an axon

  • rng (np.random) – function for random generation

morph_tool.graft.grafting_position(neuron, axon_or_donor_neuron, rng=<module 'numpy.random' from '/home/docs/checkouts/readthedocs.org/user_builds/morph-tool/envs/latest/lib/python3.8/site-packages/numpy/random/__init__.py'>)

Find out where to put the grafted axon.

If the neuron to be grafted already has a neuron reuse its starting point. Otherwise try to mimic the position of the axon with respect to dendrites in the donor axon. The position is chosen in order to preserve the direction between the axon initial segment direction and all other dendrites initial segments directions

Returns

The position where to graft the neuron