neurots.generate.tree

NeuroTS class: Tree.

Module Attributes

LAMBDA

Parameter that defines the slope of exponential probability.

DEFAULT_DIAMETER

The default diameter used to add new sections before they are diametrized later.

Classes

SectionParameters(randomness, targeting, ...)

TreeGrower(neuron, initial_direction, ...[, ...])

Tree class.

neurots.generate.tree.DEFAULT_DIAMETER = 1

The default diameter used to add new sections before they are diametrized later.

neurots.generate.tree.LAMBDA = 1.0

Parameter that defines the slope of exponential probability.

class neurots.generate.tree.SectionParameters(randomness, targeting, scale_prob, history)

Bases: tuple

_asdict()

Return a new dict which maps field names to their values.

classmethod _make(iterable)

Make a new SectionParameters object from a sequence or iterable

_replace(**kwds)

Return a new SectionParameters object replacing specified fields with new values

history

Alias for field number 3

randomness

Alias for field number 0

scale_prob

Alias for field number 2

targeting

Alias for field number 1

class neurots.generate.tree.TreeGrower(neuron, initial_direction, initial_point, parameters, distributions, context=None, random_generator=numpy.random)

Bases: object

Tree class.

Parameters:
  • neuron (morphio.mut.Morphology) – The morphology in which groups and points are stored.

  • initial_direction (list[float]) – 3D vector that defines the starting direction of the tree.

  • initial_point (list[float]) – 3D vector that defines the starting point of the tree.

  • parameters (dict) – A dictionary with tree_type, radius, randomness and targeting keys.

  • distributions (dict) – The distributions used.

  • context (Any) – The context used for the tree.

  • random_generator (numpy.random.Generator) – The random number generator to use.

_initialize_algorithm()

Initialization steps for TreeGrower.

add_section(parent, direction, first_point, stop, pathlength, process=None, children=0)

Generates a section from the parent section “act” from all the required information.

The section is added to the neuron.sections and activated.

Parameters:
  • parent (morphio.Section) – The parent of the section.

  • direction (list[float]) – The direction of the section.

  • first_point (list[float]) – The first point of the section.

  • stop (dict) – The stop criteria used for this section.

  • pathlength (float) – The path length of the section.

  • process (str) – The process type.

  • children (int) – The number of children.

append_section(section)

Append section to the MorphIO neuron.

Parameters:

section (SectionGrowerPath) – The section that is going to be appended.

Returns:

The new appended section.

Return type:

section (morphio.Section)

end()

Ends the growth.

next_point()

Operates the tree growth according to the selected algorithm.

static order_per_bif(secs)

Orders sections according to bifurcation times.

static order_per_process(secs)

Orders sections according to process type, major first.

neurots.generate.tree._create_section_parameters(input_dict)

Create section parameters from input dictionary.

Parameters:

input_dict (dict) – Input dictionary with randomness and targeting entries.

Returns:

The section parameters.

Return type:

SectionParameters