navis 1.4.0
  • Install
  • Quickstart
  • Tutorials
  • API
  • Changelog
  • Github
  • Ecosystem
  • Site
    • Page
        • navis.TreeNeuron
          • TreeNeuron
            • TreeNeuron.__init__()

    navis.TreeNeuron¶

    class navis.TreeNeuron(x, units=None, **metadata)[source]¶

    Neuron represented as hierarchical tree (i.e. a skeleton).

    Parameters:
    • x (Union[DataFrame, BufferedIOBase, str, TreeNeuron, DiGraph]) –

      Data to construct neuron from:
      • pandas.DataFrame is expected to be SWC table

      • pandas.Series is expected to have a DataFrame as .nodes - additional properties will be attached as meta data

      • str filepath is passed to navis.read_swc()

      • BufferedIOBase e.g. from open(filename)

      • networkx.DiGraph parsed by navis.nx2neuron

      • None will initialize an empty neuron

      • skeletor.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.

    __init__(x, units=None, **metadata)[source]¶

    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.

    get_graph_nx()

    Calculate and return networkX representation of neuron.

    get_igraph()

    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

    Cable length.

    connectors

    Connector table.

    core_md5

    MD5 checksum of core data.

    cycles

    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

    Hashable ID.

    igraph

    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.

    is_tree

    Whether neuron is a tree.

    label

    Label (e.g.

    leafs

    Leaf node table.

    n_branches

    Number of branch points.

    n_skeletons

    Return number of seperate skeletons in this neuron.

    n_trees

    Count number of connected trees in this neuron.

    name

    Neuron name.

    nodes

    Node table.

    postsynapses

    Table with postsynapses.

    presynapses

    Table with presynapses.

    root

    Root node(s).

    sampling_resolution

    Average cable length between 2 nodes.

    segments

    Neuron broken down into linear segments (see also .small_segments).

    simple

    Return simple neuron representation.

    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.

    soma_pos

    Search for soma and return its position.

    soma_radius

    Soma radius (e.g.

    subtrees

    List of subtrees.

    tags

    type

    Neuron type.

    units

    Units for coordinate space.

    units_xyz

    Units for coordinate space.

    volume

    Radius-based volume.

    n_leafs

    Back to top

    Source

    © Copyright 2018, Philipp Schlegel.
    Created using Sphinx 5.3.0.