neurots.generate.diametrizer

Models to create diameters of synthesized cells.

Functions

bifurcator(initial_diam, num_children, ...)

Returns the computed bifurcation diameter.

build(neuron[, input_model, neurite_types, ...])

Diametrize according to the selected method.

diametrize_constant_per_neurite(neuron[, ...])

Corrects the diameters of a morphio-neuron to make them constant per neurite.

diametrize_constant_per_section(neuron[, ...])

Corrects the diameters of a morphio-neuron to make them constant per section.

diametrize_from_root(neuron[, neurite_type, ...])

Corrects the diameters of a morphio-neuron according to the model.

diametrize_from_tips(neuron[, neurite_type, ...])

Corrects the diameters of a morphio-neuron according to the model.

diametrize_smoothing(neuron[, neurite_type])

Corrects the diameters of a morphio-neuron, by smoothing them within each section.

diametrize_uniform(neuron[, neurite_type])

Set all diameters of a morphio-neuron to a given value.

merger(section, trunk_diam, rall_ratio)

Returns the computed bifurcation diameter.

redefine_diameter_section(section, diam_ind, ...)

Hack to replace one diameter at index diam_ind with value diam_new.

root_section_filter(neuron[, tree_type])

Filter root sections according to type.

sample(data[, random_generator])

Returns a value according to the input data.

section_filter(neuron[, tree_type])

Filter all sections according to type.

section_lengths(section)

Computes all segment lengths within section.

smooth_section_diam(section[, min_diam])

Corrects the diameters of a section by smoothing between initial and final diameters.

taper_section_diam_from_root(section, ...[, ...])

Corrects the diameters of a section.

taper_section_diam_from_tips(section, ...[, ...])

Corrects the diameters of a section.

neurots.generate.diametrizer.bifurcator(initial_diam, num_children, rall_ratio, siblings_ratio)

Returns the computed bifurcation diameter.

Parameters:
  • initial_diam (float) – The initial diameter value.

  • num_children (int) – The number of children.

  • rall_ratio (float) – The rall ratio.

  • siblings_ratio (float) – The sibling ratio.

neurots.generate.diametrizer.build(neuron, input_model=None, neurite_types=None, diam_method=None, diam_params=None, random_generator=numpy.random)

Diametrize according to the selected method.

Parameters:
  • neuron (morphio.mut.Morphology) – The morphology that will be diametrized.

  • input_model (dict) – The model parameters.

  • neurite_types (list[str]) – Only the neurites of these types are diametrized.

  • diam_method (str or callable) – The name of the diametrization method.

  • diam_params (dict) – The parameters passed to the diametrization method.

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

If diam_method is a string matching the models in diam_methods it will use an internal diametrizer. If a function is provided, it will use this function to diametrize the cells. This function should have the following arguments:

  • neuron (morphio.mut.Morphology): The morphology that will be diametrized.

  • tree_type (str): Only the neurites of this type are diametrized.

  • model_params (dict): The model parameters (optional).

  • diam_params (dict): The parameters passed to the diametrization method (optional).

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

    (optional).

and should only update the neuron object.

neurots.generate.diametrizer.diametrize_constant_per_neurite(neuron, neurite_type=None)

Corrects the diameters of a morphio-neuron to make them constant per neurite.

Parameters:
neurots.generate.diametrizer.diametrize_constant_per_section(neuron, neurite_type=None)

Corrects the diameters of a morphio-neuron to make them constant per section.

Parameters:
neurots.generate.diametrizer.diametrize_from_root(neuron, neurite_type=None, *, model_params, random_generator=numpy.random)

Corrects the diameters of a morphio-neuron according to the model.

Starts from the root and moves towards the tips.

Parameters:
neurots.generate.diametrizer.diametrize_from_tips(neuron, neurite_type=None, *, model_params, random_generator=numpy.random)

Corrects the diameters of a morphio-neuron according to the model.

Starts from the tips and moves towards the root.

Parameters:
neurots.generate.diametrizer.diametrize_smoothing(neuron, neurite_type=None)

Corrects the diameters of a morphio-neuron, by smoothing them within each section.

Parameters:
neurots.generate.diametrizer.diametrize_uniform(neuron, neurite_type=None, *, diam_params)

Set all diameters of a morphio-neuron to a given value.

Parameters:
  • neuron (morphio.mut.Morphology) – The morphology that will be diametrized.

  • neurite_type (morphio.SectionType) – Only the neurites of this type are diametrized.

  • diam_params (dict) – The model parameters (should only contain a ‘diameter’ entry).

neurots.generate.diametrizer.merger(section, trunk_diam, rall_ratio)

Returns the computed bifurcation diameter.

Parameters:
  • section (morphio.mut.Section) – The section whose diameter is updated.

  • trunk_diam (float) – The trunk diameter.

  • rall_ratio (float) – The rall ratio.

neurots.generate.diametrizer.redefine_diameter_section(section, diam_ind, diam_new)

Hack to replace one diameter at index diam_ind with value diam_new.

Parameters:
  • section (morphio.mut.Section) – The section whose diameter is updated.

  • diam_ind (int) – The index to replace.

  • diam_new (float) – The new diameter value.

neurots.generate.diametrizer.root_section_filter(neuron, tree_type=None)

Filter root sections according to type.

neurots.generate.diametrizer.sample(data, random_generator=numpy.random)

Returns a value according to the input data.

Parameters:
neurots.generate.diametrizer.section_filter(neuron, tree_type=None)

Filter all sections according to type.

neurots.generate.diametrizer.section_lengths(section)

Computes all segment lengths within section.

Parameters:

section (morphio.Section) – The section whose length is computed.

Returns:

The total length of the section.

Return type:

float

neurots.generate.diametrizer.smooth_section_diam(section, min_diam=0.07)

Corrects the diameters of a section by smoothing between initial and final diameters.

Parameters:
  • section (morphio.mut.Section) – The section whose diameters are updated.

  • min_diam (float) – The min diameter value.

neurots.generate.diametrizer.taper_section_diam_from_root(section, initial_diam, taper, min_diam=0.07, max_diam=100.0)

Corrects the diameters of a section.

Parameters:
  • section (morphio.mut.Section) – The section whose diameters are updated.

  • initial_diam (float) – The initial diameter value.

  • taper (float) – The taper value.

  • min_diam (float) – The min diameter value.

  • max_diam (float) – The max diameter value.

neurots.generate.diametrizer.taper_section_diam_from_tips(section, final_diam, taper, min_diam=0.07, max_diam=100.0)

Corrects the diameters of a section.

Parameters:
  • section (morphio.mut.Section) – The section whose diameters are updated.

  • final_diam (float) – The final diameter value.

  • taper (float) – The taper value.

  • min_diam (float) – The min diameter value.

  • max_diam (float) – The max diameter value.