core_utils
navis.core.core_utils.FailedRun #
Class representing a failed run.
Source code in navis/core/core_utils.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 | |
navis.core.core_utils.add_units #
Add neuron units (if present) to output of function.
Source code in navis/core/core_utils.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
navis.core.core_utils.tangents_and_alpha #
Compute tangent vectors and alpha from a point cloud.
For each point: take its k nearest neighbours (itself included), form the scatter matrix of that neighbourhood about its centroid, and return the principal direction plus (l1 - l2) / (l1 + l2 + l3) for its eigenvalues.
Uses navis_fastcore.dotprops if available - it fuses the k-NN and the eigendecomposition into one parallel Rust pass and is ~15x faster than the cKDTree + N-SVDs route below - and falls back to scipy/numpy otherwise.
Note the two agree exactly except where the k-NN search hits a tied distance, which grid-quantised coordinates produce readily: there the k-th neighbour is ambiguous and the two trees may pick different points. That affects ~0.3% of points on the example neurons and moves NBLAST scores by ~1e-4 without changing match ranking.
| PARAMETER | DESCRIPTION |
|---|---|
points | TYPE: |
k | TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
vect | Unit tangent vectors. The sign is arbitrary (an eigenvector is only defined up to sign, and NBLAST scores on TYPE: |
alpha | TYPE: |
Source code in navis/core/core_utils.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
navis.core.core_utils.temp_property #
Check if neuron is stale. Clear cached temporary attributes if it is.
Source code in navis/core/core_utils.py
139 140 141 142 143 144 145 146 147 148 149 | |