navis.NeuronList¶
- class navis.NeuronList(x, make_copy=False, make_using=None, parallel=False, n_cores=1, **kwargs)[source]¶
Collection of neurons.
Gives quick access to neurons’ attributes and functions.
- Parameters:
x (list | array | TreeNeuron | MeshNeuron | Dotprops | NeuronList) –
Data to construct neuronlist from. Can be either:
Tree/MeshNeuron(s) or Dotprops
NeuronList(s)
Anything that constructs a Tree/MeshNeuron
List of the above
make_copy (bool, optional) – If True, Neurons are deepcopied before being assigned to the NeuronList.
make_using (function | class, optional) – Function or class used to construct neurons from elements in
x
if they aren’t already neurons. By default, will usenavis.Neuron
to try to infer what kind of neuron can be constructed.parallel (bool) – If True, will use parallel threads when initialising the NeuronList. Should be slightly up to a lot faster depending on the numbers of cores and the input data.
n_cores (int) – Number of cores to use for when parallel=True. Defaults to half the available cores.
**kwargs – Will be passed to constructor of Tree/MeshNeuron (see
make_using
).
Methods
__init__
(x[, make_copy, make_using, ...])append
(v)Add neuron(s) to this list.
apply
(func, *[, parallel, n_cores, ...])Apply function across all neurons in this NeuronList.
copy
(**kwargs)Return copy of this NeuronList.
head
([N])Return summary for top N neurons.
Helper to mimic
pandas.DataFrame.itertuples()
.mean
()Return mean numeric and boolean values over all neurons.
memory_usage
([deep, estimate, sample])Return estimated size in memory of this NeuronList.
plot2d
(**kwargs)Plot neuron in 2D using
plot2d()
.plot3d
(**kwargs)Plot neuron in 3D using
plot3d()
.remove_duplicates
([key, keep, inplace])Remove duplicate neurons from list.
sample
([N])Return random subset of neurons.
set_neuron_attributes
(x, name[, register, na])Set attributes of neurons contained in the NeuronList.
sort_values
(key[, ascending])Sort neurons by given key.
sum
()Return sum numeric and boolean values over all neurons.
summary
([N, add_props, progress])Get summary over all neurons in this NeuronList.
tail
([N])Return summary for bottom N neurons.
unmix
()Split into NeuronLists of the same neuron type.
Attributes
Bounding box across all neurons in the list.
Return True if NeuronList is empty.
Return True if contains neurons with non-unique IDs.
Return True if contains more than one type of neuron.
neurons
Neurons contained in this NeuronList.
Shape of NeuronList (N, ).
Return neuron types present in this list.
cable_length
soma
root
graph
igraph