navis.TreeNeuron¶
- class navis.TreeNeuron(x, units=None, **metadata)[source]¶
Neuron represented as hierarchical tree (i.e. a skeleton).
- Parameters:
x –
- Data to construct neuron from:
pandas.DataFrame
is expected to be SWC tablepandas.Series
is expected to have a DataFrame as.nodes
- additional properties will be attached as meta datastr
filepath is passed tonavis.read_swc()
BufferedIOBase
e.g. fromopen(filename)
networkx.DiGraph
parsed by navis.nx2neuronNone
will initialize an empty neuronskeletor.Skeleton
TreeNeuron
- in this case we will try to copy every attribute
units (str | pint.Units | pint.Quantity) – Units for coordinates. Defaults to
None
(dimensionless). Strings must be parsable by pint: e.g. “nm”, “um”, “micrometer” or “8 nanometers”.**metadata – Any additional data to attach to neuron.
Initialize Skeleton Neuron.
Methods
__init__
(x[, units])Initialize Skeleton Neuron.
cell_body_fiber
([reroot_soma, inplace])Prune neuron to its cell body fiber.
convert_units
(to[, inplace])Convert coordinates to different unit.
copy
([deepcopy])Return a copy of the neuron.
downsample
([factor, inplace])Downsample the neuron by given factor.
Calculate and return networkX representation of neuron.
Calculate and return iGraph representation of neuron.
map_units
(units[, on_error])Convert units to match neuron space.
memory_usage
([deep, estimate])Return estimated memory usage of this neuron.
plot2d
(**kwargs)Plot neuron using
navis.plot2d()
.plot3d
(**kwargs)Plot neuron using
navis.plot3d()
.prune_at_depth
(depth[, source, inplace])Prune all neurites past a given distance from a source.
prune_by_longest_neurite
([n, reroot_soma, ...])Prune neuron down to the longest neurite.
prune_by_strahler
(to_prune[, inplace])Prune neuron based on Strahler order.
prune_by_volume
(v[, mode, ...])Prune neuron by intersection with given volume(s).
prune_distal_to
(node[, inplace])Cut off nodes distal to given nodes.
prune_proximal_to
(node[, inplace])Remove nodes proximal to given node.
prune_twigs
(size[, inplace, recursive])Prune terminal twigs under a given size.
reload
([inplace])Reload neuron.
reroot
(new_root[, inplace])Reroot neuron to given node ID or node tag.
resample
(resample_to[, inplace])Resample neuron to given resolution.
snap
(locs[, to])Snap xyz location(s) to closest node or synapse.
summary
([add_props])Get a summary of this neuron.
to_swc
([filename])Generate SWC file from this neuron.
Attributes
CORE_DATA
Core data table(s) used to calculate hash
EQ_ATTRIBUTES
Attributes to be used when comparing two neurons.
SUMMARY_PROPS
Attributes used for neuron summary
TEMP_ATTR
Temporary attributes that need to be regenerated when data changes.
bbox
Bounding box (includes connectors).
branch_points
Branch node table.
Cable length.
connectors
Connector table.
core_md5
MD5 checksum of core data.
Cycles in neuron (if any).
datatables
Names of all DataFrames attached to this neuron.
edge_coords
Coordinates of edges between nodes.
edges
Edges between nodes.
ends
End node table (same as leafs).
extents
Extents of neuron in x/y/z direction (includes connectors).
geodesic_matrix
Matrix with geodesic (along-the-arbor) distance between nodes.
graph
Networkx Graph representation of this neuron.
id
ID of the neuron.
iGraph representation of this neuron.
is_isometric
Test if neuron is isometric.
is_locked
Test if neuron is locked.
is_stale
Test if temporary attributes might be outdated.
Whether neuron is a tree.
label
Label (e.g. for legends).
leafs
Leaf node table.
Number of branch points.
Number of leaf nodes.
Number of seperate skeletons in this neuron.
Count number of connected trees in this neuron.
name
Neuron name.
Node table.
postsynapses
Table with postsynapses (filtered from connectors table).
presynapses
Table with presynapses (filtered from connectors table).
Root node(s).
Average cable length between child -> parent nodes.
Neuron broken down into linear segments (see also .small_segments).
Simplified representation consisting only of root, branch points and leafs.
small_segments
Neuron broken down into small linear segments (see also .segments).
soma
Search for soma and return node ID(s).
soma_detection_label
Label for soma detection.
soma_detection_radius
Minimum radius for soma detection.
Search for soma and return its position.
soma_radius
Soma radius (e.g. for plotting).
List of subtrees.
surface_area
Radius-based lateral surface area.
tags
type
Neuron type.
units
Units for coordinate space.
units_xyz
Units for coordinate space.
Radius-based volume.