neurom.ezy.neuron.Neuron¶
-
class
neurom.ezy.neuron.
Neuron
(neuron, iterable_type=<built-in function array>)¶ Bases:
neurom.core.neuron.Neuron
Class with basic analysis and plotting functionality
By default returns iterables as numpy.arrays and applies no filtering.
Parameters: - neuron – neuron-like object
- iterable_type – type of iterable to return from methods returning collections (e.g list, tuple, numpy.array).
Raises: - neurom.exceptions.SomaError if no soma can be built from the data
- neurom.exceptions.IDSequenceError if ID sequence invalid
Example
get the segment lengths of all apical dendrites in a neuron morphology.
>>> from neurom import ezy >>> nrn = ezy.load_neuron('test_data/swc/Neuron.swc') >>> nrn.get_segment_lengths(ezy.TreeType.apical_dendrite)
Example
iterate over the segment surface areas of all axons in a neuron morphology.
>>> from neurom import ezy >>> from neurom.analysis import morphmath as mm >>> nrn = ezy.load_neuron('test_data/swc/Neuron.swc') >>> for a in nrn.iter_segments(mm.segment_area, ezy.TreeType.axon): print (a)
Example
calculate the mean volume of all neurite segments on a neuron morphology
>>> from neurom import ezy >>> from neurom.analysis import morphmath as mm >>> import numpy as np >>> nrn = ezy.load_neuron('test_data/swc/Neuron.swc') >>> mv = np.mean([v for v in nrn.iter_segments(mm.segment_volume)])
Example
use lists instead of numpy arrays and get section lengths for the axon. Read an HDF5 v1 file:
>>> from neurom import ezy >>> nrn = ezy.load_neuron('test_data/h5/v1/Neuron.h5', iterable_type=list) >>> nrn.get_section_lengths(ezy.TreeType.axon)
Example
plot the neuron and save to a file
>>> fig, ax = nrn.plot() >>> fig.show() >>> fig.savefig('nrn.png')
Methods
__init__
get_local_bifurcation_angles
Get local bifircation angles of all segments of a given type get_n_neurites
Get the number of neurites of a given type in a neuron get_n_sections
Get the number of sections of a given type get_n_sections_per_neurite
Get an iterable with the number of sections for a given neurite type get_remote_bifurcation_angles
Get remote bifircation angles of all segments of a given type get_section_lengths
Get an iterable containing the lengths of all sections of a given type get_section_path_distances
Get section path distances of all neurites of a given type The section path distance is measured to the neurite’s root. get_section_radial_distances
Get an iterable containing section radial distances to origin of all neurites of a given type get_segment_lengths
Get an iterable containing the lengths of all segments of a given type get_soma_radius
Get the radius of the soma get_soma_surface_area
Get the surface area of the soma. get_trunk_origin_radii
Get the trunk origin radii of a given type in a neuron get_trunk_section_lengths
Get the trunk section lengths of a given type in a neuron iter_neurites
Iterate over collection of neurites applying iterator_type iter_points
Iterator to neurite points with mapping iter_sections
Iterator to neurite sections with mapping iter_segments
Iterator to neurite segments with mapping neurite_loop
Iterate over collection of neurites applying iterator_type