neat.MorphTree.create_new_tree

MorphTree.create_new_tree(loc_arg, name='new tree', fake_soma=False, new_tree=None)[source]

Creates a new tree where the provided location in loc_arg are now the nodes. Note that if the soma is not in the list of locations, a common root location might be added if necessary.

Distance relations between locations are maintained (note that this relation is stored in L attribute of neat.MorphNode, the p3d attribute containing the 3d coordinates does not maintain distances)

The radius of a node is taken as the average radius between the location associated with the node and the location associated with the parent node, weighted by the lengths of all individual nodes.

Parameters:
  • loc_arg (list of neat.MorphLoc or string) – the locations.

  • name (str (default 'new tree')) – The name under which the locations associated to the tree are stored.

  • fake_soma (bool (default False)) – if True, finds the common root of the set of locations and uses that as the soma of the new tree. If False, the real soma is used.

  • new_tree (None or instance of subclass of neat.MorphTree) – The new tree instance.

Returns:

The new tree.

Return type:

neat.MorphTree

Raises:

ValueError – If new_tree is not a subclass of self.__class__