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



Delete all axons.


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.


Delete all axons.


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/'>)

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.

  • 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/'>)

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


The position where to graft the neuron