The elements
module¶
|
Container to facilitate post processing of SWC files branch path is a tuple with (xy, r, theta, diameter) |
|
|
|
Container to allow direct access to neurites. |
|
Container allowing direct access to a neuron. |
|
Container to facilitate drawing of dendrograms |
|
Stores all the neurons in an unique object. |
|
alias of |
|
|
|
The unit registry stores the definitions and relationships between units. |
|
Return the application registry. |
|
Set the application registry, which is used for unpickling operations and when invoking pint.Quantity or pint.Unit directly. |
Containers for Neuronal shapes
- class dense.elements.Neurite(branches, neurite_type, name='neurite', parent=None)[source]¶
Container to allow direct access to neurites.
Also facilitates post processing of SWC files. branch path is a tuple with (xy, r, theta, diameter)
- property branches¶
Return the branches composing the neurite
- property branching_points¶
Return the B locations of the branching points, shape (B, 2)
- property diameter¶
Diameter of the different segments along the neurite
- property empty¶
Whether the neurite is empty or not
- get_properties(property_name=None, level=None)[source]¶
Get the object’s properties.
- Parameters
- Returns
status – Properties of the objects’ status: a single value if property_name was specified, the full status
dict
otherwise.- Return type
variable
- get_state(observable=None)[source]¶
Return the values of all or one state observable of the neurite.
- Parameters
observable (str, optional (default: all observables)) – Observable to query.
- Returns
state
- Return type
dict or scalar value
See also
- property name¶
Name of the neurite
- property neuron¶
Name of the parent neuron
- plot_dendrogram(axis=None, show_node_id=False, aspect_ratio=None, vertical_diam_frac=0.2, ignore_diameter=False, show=True, **kwargs)[source]¶
Plot the dendrogram of a neurite.
- Parameters
neurite (
Neurite
object) – Neurite for which the dendrogram should be plotted.axis (matplotlib.Axes.axis object, optional (default: new one)) – Axis on which the dendrogram should be plotted.
show_node_id (bool, optional (default: False)) – Display each node number on the branching points.
aspect_ratio (float, optional (default: variable)) – Whether to use a fixed aspect ratio. Automatically set to 1 if show_node_id is True.
vertical_diam_frac (float, optional (default: 0.2)) – Fraction of the vertical spacing taken by the branch diameter.
ignore_diameter (bool, optional (default: False)) – Plot all the branches with the same width.
show (bool, optional (default: True)) – Whether the figure should be shown right away.
**kwargs (arguments for
matplotlib.patches.Rectangle
) – For instance facecolor or edgecolor.
- Returns
- Return type
The axis on which the plot was done.
See also
- property r¶
Length of the different segments along the neurite
- set_properties(params)[source]¶
Update the neuronal parameters using the entries contained in params.
- Parameters
params (dict) – New neurite parameters.
- property single_branch¶
Whether the neurite is composed of a single branch
- property taper_rate¶
- property theta¶
Angles of the different segments along the neurite
- property total_length¶
Total length of the neurite
- property xy¶
Points constituting the different segments along the neurite
- class dense.elements.Neuron(gid, **kwargs)[source]¶
Container allowing direct access to a neuron.
- create_neurites(num_neurites=1, params=None, angles=None, names=None)[source]¶
Create new neurites.
Neurite types (axon or dendrite) are based on the neurite names: axon must always be named “axon”, all other names will be associated to a dendrite.
- Parameters
num_neurites (int, optional (default: 1)) – Number of neurites that will be added to the neuron.
params (dict, optional (default: None)) – Parameters of the neurites.
angle (list, optional (default: automatically positioned)) – Angles of the newly created neurites.
names (str or list, optional (default: "axon" and "dendrite_X")) – Names of the created neurites, if not provided, will an “axon” or a dendrite with default name “dendrite_X” (X being a number) will be created, depending on whether the neuron is supposed to have an axon or not, and depending on the number of pre-existing neurites.
See also
- delete_neurites(neurite_names=None)[source]¶
Delete neurites.
- Parameters
neurite_names (str or list, optional (default: all neurites)) – Neurites which will be deleted.
See also
- property dendrites¶
Return a dict containing one
Neurite
container for each dendrite, with its name as key.
- get_properties(property_name=None, level=None, neurite=None)[source]¶
Get the neuron’s properties.
- Parameters
property_name (str, optional (default: None)) – Name of the property that should be queried. By default, the full dictionary is returned.
level (str, optional (default: highest)) – Level at which the status should be obtained. Should be among “neuron”, “neurite”, or “growth_cone”.
neurite (str optional (default: None)) – Neurite that should be queried (either axon or dendrites). By default, both dictionaries are returned inside the neuronal status dictionary. If neurite is specified, only the parameters of this neurite will be returned.
- Returns
status – Properties of the objects’ status: a single value if property_name was specified, the full status
dict
otherwise.- Return type
variable
- get_state(observable=None)[source]¶
Return the values of all or one state observable of the neuron.
- Parameters
observable (str, optional (default: all observables)) – Observable to query.
- Returns
state
- Return type
dict or scalar value
See also
get_state()
,get_properties()
- property neurites¶
Return a dict containing one
Neurite
container for each neurite, with its name as key.
- set_properties(params=None, neurite_params=None)[source]¶
Update the neuronal (and optionaly neurite) parameters.
- to_neuroml(filename, resolution=10, write=True)[source]¶
Save the neuron as a NeuroML (.nml) object.
- property total_length¶
Total arbor length of the neuron
- class dense.elements.Node(node_id, tree=None, parent=None, diameter=None, dist_to_parent=None, pos=None)[source]¶
Container to facilitate drawing of dendrograms
- class dense.elements.Population(population=None, info=None, name='no_name')[source]¶
Stores all the neurons in an unique object. Keeps data and info on each neuron. Each neuron is identified with its gid. Ensemble keeps the info.json file. In case the info.json is absent it’s possile to pass a description with a dictionary with name and description
- get_properties(property_name=None, level=None, neurite=None)[source]¶
Get the neurons’s properties.
- Parameters
property_name (str, optional (default: None)) – Name of the property that should be queried. By default, the full dictionary is returned.
level (str, optional (default: highest)) – Level at which the status should be obtained. Should be among “neuron”, “neurite”, or “growth_cone”.
neurite (str optional (default: None)) – Neurite that should be queried (either axon or dendrites). By default, both dictionaries are returned inside the neuronal status dictionary. If neurite is specified, only the parameters of this neurite will be returned.
- Returns
status – Properties of the objects’ status: a single value if property_name was specified, the full status
dict
otherwise.- Return type
variable
- property ids¶
- property positions¶
- set_properties(params=None, axon_params=None, dendrites_params=None)[source]¶
Update the neuronal parameters using the entries contained in params.
- property size¶
Number of neurons in the Population