neurots.generate.grower

NeuroTS class: Grower object that contains the grower functionality.

Classes

NeuronGrower(input_parameters, ...[, ...])

The main class for growing algorithms of neurons.

class neurots.generate.grower.NeuronGrower(input_parameters, input_distributions, context=None, external_diametrizer=None, skip_preprocessing=False, rng_or_seed=numpy.random)

Bases: object

The main class for growing algorithms of neurons.

A Grower object is a container for a Neuron, encoded in the (groups, points) structure, as a morphIO Morphology object. A set of input distributions that store the data consumed by the algorithms and the user-selected parameters are also stored.

Parameters:
  • input_parameters (dict) – The user-defined parameters.

  • input_distributions (dict) – Distributions extracted from biological data.

  • context (Any) – An object containing contextual information.

  • external_diametrizer (Callable) – Diametrizer function for external diametrizer module

  • skip_proprocessing (bool) – If set to False, the parameters and distributions are preprocessed with registered validator and preprocessors.

  • rng_or_seed (int or numpy.random.Generator) – A random number generator to use. If an int is given, it is passed to numpy.random.default_rng() to create a new random number generator.

  • trunk_orientations_class (Generic[OrientationManagerBase]) – The class used to build the trunk orientation manager. This class should inherit from neurots.generate.orientations.OrientationManagerBase.

_3d_angles_grow_trunks()

Grow trunk with 3d_angles method via orientation.OrientationManager() class.

Parameters:

input_parameters_with_3d_anglles (dict) – input_parameters with fits for 3d angles

_convert_orientation2points(orientation, n_trees, distr, params)

Return soma point from given orientations.

Checks the type of orientation input and returns the soma points generated by the corresponding selection.

Currently accepted orientations include the following options: * list of 3D points: select the orientation externally. * None: creates a list of orientations according to the biological distributions. * from_space: generates orientations depending on spatial input (not implemented yet).

_grow_soma(soma_type='contour')

Generates a soma based on the input_distributions.

The coordinates of the soma contour are retrieved from the trunks.

_grow_trunks()

Grow the trunks.

Two methods are available, depending on the data present in the input_parameters. If no 3d_angles entry is present, we grow trunks with _simple_grow_trunks() else we fit the raw binned 3d angle data and apply _3d_angles_grow_trunks().

_init_diametrizer(external_diametrizer=None)

Set a diametrizer function.

_post_grow()

Actions after the morphology has been grown and before its diametrization.

_simple_grow_trunks()

Grow the trunks.

Generates the initial points of each tree, which depend on the selected tree types and the soma surface. All the trees start growing from the surface of the soma. The outgrowth direction is either specified in the input parameters, as parameters['type']['orientation'] or it is randomly chosen according to the biological distribution of trunks on the soma surface if orientation is None.

grow()

Generates a neuron according to the input_parameters and the input_distributions.

The neuron consists of a soma and a list of trees encoded in the h5 format as a set of points and groups.

Returns:

The grown neuron.

Return type:

morphio.mut.Morphology

next()

Call the “next” method of each neurite grower.

neurots.generate.grower._load_json(path_or_json)

Copy the given data if it is a dictionary or a list or load it if it is a file path.