graph_utils
navis.graph.graph_utils.match_mesh_skeleton #
Match vertices of MeshNeuron to nodes of TreeNeuron.
| PARAMETER | DESCRIPTION |
|---|---|
mesh | TYPE: |
skeleton | TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
np.ndarray | Array of skeleton node IDs for each vertex in the mesh. |
Source code in navis/graph/graph_utils.py
3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 | |
navis.graph.graph_utils.skeleton_edges #
A skeleton's child -> parent edges as 0-based node indices.
The fastcore graph primitives all work in index space (0 .. n_nodes - 1) off a plain edge list, whereas navis works in node IDs - so anything wiring one to the other needs this.
| RETURNS | DESCRIPTION |
|---|---|
edges | Roots have no parent and simply contribute no edge. TYPE: |
node_ids | The node ID for each index, i.e. the inverse mapping. TYPE: |
Source code in navis/graph/graph_utils.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | |