neurots.generate.diametrizer¶
Models to create diameters of synthesized cells.
Functions
|
Returns the computed bifurcation diameter. |
|
Diametrize according to the selected method. |
|
Corrects the diameters of a morphio-neuron to make them constant per neurite. |
|
Corrects the diameters of a morphio-neuron to make them constant per section. |
|
Corrects the diameters of a morphio-neuron according to the model. |
|
Corrects the diameters of a morphio-neuron according to the model. |
|
Corrects the diameters of a morphio-neuron, by smoothing them within each section. |
|
Set all diameters of a morphio-neuron to a given value. |
|
Returns the computed bifurcation diameter. |
|
Hack to replace one diameter at index diam_ind with value diam_new. |
|
Filter root sections according to type. |
|
Returns a value according to the input data. |
|
Filter all sections according to type. |
|
Computes all segment lengths within section. |
|
Corrects the diameters of a section by smoothing between initial and final diameters. |
|
Corrects the diameters of a section. |
|
Corrects the diameters of a section. |
- neurots.generate.diametrizer.bifurcator(initial_diam, num_children, rall_ratio, siblings_ratio)¶
Returns the computed bifurcation diameter.
- 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 indiam_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:
neuron (morphio.mut.Morphology) – The morphology that will be diametrized.
neurite_type (morphio.SectionType) – Only the neurites of this type are diametrized.
- 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:
neuron (morphio.mut.Morphology) – The morphology that will be diametrized.
neurite_type (morphio.SectionType) – Only the neurites of this type are diametrized.
- 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:
neuron (morphio.mut.Morphology) – The morphology that will be diametrized.
neurite_type (morphio.SectionType) – Only the neurites of this type are diametrized.
model_params (dict) – The model parameters.
random_generator (numpy.random.Generator) – The random number generator to use.
- 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:
neuron (morphio.mut.Morphology) – The morphology that will be diametrized.
neurite_type (morphio.SectionType) – Only the neurites of this type are diametrized.
model_params (dict) – The model parameters.
random_generator (numpy.random.Generator) – The random number generator to use.
- neurots.generate.diametrizer.diametrize_smoothing(neuron, neurite_type=None)¶
Corrects the diameters of a morphio-neuron, by smoothing them within each section.
- Parameters:
neuron (morphio.mut.Morphology) – The morphology that will be diametrized.
neurite_type (morphio.SectionType) – Only the neurites of this type are diametrized.
- 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:
data (list) – The data to sample from.
random_generator (numpy.random.Generator) – The random number generator to use.
- 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:
- 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.