Morphology
Functions related to analysing or manipulating neuron morpology.
navis_fastcore.synapse_flow_centrality(node_ids, parent_ids, presynapses, postsynapses, mode='sum')
Calculate synapse flow centrality for this neuron.
Please note that this implementation currently produces slightly different results than the implementation in navis. I'm not sure why that is but the differences seem to be negligible.
PARAMETER | DESCRIPTION |
---|---|
node_ids |
TYPE: |
parent_ids |
TYPE: |
presynapses |
TYPE: |
postsynapses |
TYPE: |
mode |
TYPE: |
RETURNS | DESCRIPTION |
---|---|
cc | Synapse flow centrality for each node. TYPE: |
navis_fastcore.strahler_index(node_ids, parent_ids, method='standard', to_ignore=None, min_twig_size=None)
Calculcate Strahler Index.
PARAMETER | DESCRIPTION |
---|---|
node_ids |
TYPE: |
parent_ids |
TYPE: |
method |
TYPE: |
to_ignore |
TYPE: |
min_twig_size |
TYPE: |
RETURNS | DESCRIPTION |
---|---|
strahler_index | Strahler Index for each node. TYPE: |
Examples:
navis_fastcore.prune_twigs(node_ids, parent_ids, threshold, weights=None, mask=None)
Prune twigs shorter than a given threshold.
PARAMETER | DESCRIPTION |
---|---|
node_ids |
TYPE: |
parent_ids |
TYPE: |
threshold |
TYPE: |
weights |
TYPE: |
mask |
TYPE: |
RETURNS | DESCRIPTION |
---|---|
keep | Node IDs to keep. TYPE: |
Examples:
>>> import navis_fastcore as fastcore
>>> import numpy as np
>>> node_ids = np.arange(7)
>>> parent_ids = np.array([-1, 0, 1, 2, 1, 4, 5])
>>> fastcore.prune_twigs(node_ids, parent_ids, 2)
array([0, 1, 4, 5, 6])
>>> mask = np.array([True, True, True, False, True, True, True])
>>> fastcore.prune_twigs(node_ids, parent_ids, 2, mask=mask)