Package: nat.fastcore 0.13.0

nat.fastcore: Re-implementation of nat core functions in Rust

A re-implementation of core 'nat' (Neuroanatomy Toolbox) functions in Rust for speed. Provides fast skeleton/tree (DAG) operations (geodesic distances, Strahler order, segment generation, twig pruning, synapse flow centrality, node classification, skeleton healing), mesh connected components, NBLAST/synNBLAST neuron similarity scoring, CMTK and Elastix spatial transforms (applying a registration to points without needing CMTK or Elastix installed), and landmark-based warps (thin-plate spline, moving least squares), exposed to R via extendr.

Authors:Philipp Schlegel [aut, cre]

nat.fastcore_0.13.0.tar.gz
nat.fastcore_0.13.0.zip(r-4.7-x86_64)nat.fastcore_0.13.0.zip(r-4.6-x86_64)nat.fastcore_0.13.0.zip(r-4.5-x86_64)
nat.fastcore_0.13.0.tgz(r-4.6-x86_64)nat.fastcore_0.13.0.tgz(r-4.6-arm64)nat.fastcore_0.13.0.tgz(r-4.5-x86_64)nat.fastcore_0.13.0.tgz(r-4.5-arm64)
nat.fastcore_0.13.0.tar.gz(r-4.7-arm64)nat.fastcore_0.13.0.tar.gz(r-4.7-x86_64)nat.fastcore_0.13.0.tar.gz(r-4.6-arm64)nat.fastcore_0.13.0.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
nat.fastcore/json (API)

# Install 'nat.fastcore' in R:
install.packages('nat.fastcore', repos = c('https://schlegelp.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/schlegelp/fastcore-rs/issues

On CRAN:

Conda:

dagnavisneuronsrustcargo

3.30 score 2 stars 3 scripts 2 mentions 98 exports 0 dependencies

Last updated from:5ada9d8347. Checks:8 OK, 4 WARNING, 3 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK135
linux-devel-x86_64OK204
source / vignettesOK260
linux-release-arm64OK176
linux-release-x86_64OK165
macos-release-arm64WARNING217
macos-release-x86_64WARNING500
macos-oldrel-arm64WARNING212
macos-oldrel-x86_64WARNING709
windows-devel-arm64FAIL389
windows-devel-x86_64OK323
windows-release-arm64FAIL324
windows-release-x86_64OK266
windows-oldrel-x86_64OK286
wasm-releaseFAIL103

Exports:adjacencyall_dists_to_rootbetweennessboundary_halfedgesbreak_segmentsbridgeschild_to_parent_distsclassify_nodescmtk_affinecmtk_dimscmtk_domaincmtk_readcmtk_spacingcmtk_versionscmtk_xformcmtk_xform_invconnected_componentsconnected_components_graphcontract_nodescontract_verticesdescendant_countsdescendantsdist_to_rootdownsample_skeletonelastix_affineelastix_grid_originelastix_grid_sizeelastix_grid_spacingelastix_kindselastix_probe_invertibleelastix_readelastix_xformelastix_xform_invexposed_halfedgesfast_hclustgenerate_segmentsgeodesic_clustersgeodesic_distancesgeodesic_farthestgeodesic_farthest_meshgeodesic_matrix_graphgeodesic_matrix_meshgeodesic_mst_graphgeodesic_mst_meshgeodesic_nearestgeodesic_nearest_meshgeodesic_pairsgeodesic_pathgeodesic_predecessorsget_num_threadshas_cyclesheal_skeletonleaf_orderlevel_set_componentslongest_pathlongest_pathsmesh_connected_componentsminimum_spanning_treemls_affinemls_transformmls_xformnblastnblast_allbyallnblast_distnblast_hclustnblast_knnnblast_pairsnode_indicesparents_from_edgespaths_to_rootprune_twigsrerootreroot_rewireresample_skeletonset_num_threadssimplify_meshsimplify_mesh_losslesssimplify_rdpsimplify_skeletonsimplify_vwsmat_auto_limitsmooth_meshsmooth_skeletonsmooth_skeleton_gaussianstitch_fragmentsstrahler_indexsubtree_heightsymmetrizesynapse_flow_centralitysynblastsynblast_allbyalltps_affinetps_coefstps_transformtps_xformtrace_loopstriangulate_ringsunique_edges

Dependencies:

Readme and manuals

Help Manual

Help pageTopics
The skeleton's adjacency matrix, as the three arrays of a CSR matrix.adjacency
Compute all distances to root.all_dists_to_root
Betweenness centrality, in 'O(N)' rather than Brandes' 'O(V*E)'.betweenness
Every edge of a mesh that has only one face on it.boundary_halfedges
Break the tree into its linear segments (one integer vector per segment).break_segments
Which edges are bridges — the ones whose removal would disconnect their component.bridges
Calculate child -> parent distances.child_to_parent_dists
Classify nodes into roots (0), leaves (1), branch points (2) and slabs (3).classify_nodes
Properties of a CMTK registrationcmtk_affine cmtk_dims cmtk_domain cmtk_properties cmtk_spacing cmtk_versions
Read a CMTK registrationcmtk_read
Apply a CMTK registration to pointscmtk_xform
Apply a CMTK registration to points, backwardscmtk_xform_inv
Connected components.connected_components
Connected components of a graph given as an edge list.connected_components_graph
Collapse groups of nodes onto a representative and rewire what is left.contract_nodes
Contract nodes onto new ids, returning the simplified edge list.contract_vertices
How many nodes lie strictly below each node.descendant_counts
Every node in the sub-tree below each source.descendants
Return path length from a single node to the root.dist_to_root
Keep every 'factor'-th node of every segment, dropping the rest.downsample_skeleton
Can an Elastix transform be inverted?elastix_probe_invertible
Properties of an Elastix transformelastix_affine elastix_grid_origin elastix_grid_size elastix_grid_spacing elastix_kinds elastix_properties
Read an Elastix transformelastix_read
Apply an Elastix transform to pointselastix_xform
Invert an Elastix transform on pointselastix_xform_inv
The edges a subset is about to expose. Takes the faces _before_ subsetting.exposed_halfedges
Hierarchical clustering without the 65536 observation limitfast_hclust
Generate linear segments while maximising segment lengths.generate_segments
Greedily partition nodes into connected clusters of bounded radius.geodesic_clusters
Geodesic distances between nodes.geodesic_distances
Distance to the farthest target for each source.geodesic_farthest
Distance to the farthest target vertex, for each source vertex of a mesh.geodesic_farthest_mesh
Geodesic distances over an arbitrary graph given as an edge list.geodesic_matrix_graph
Geodesic ("along-the-mesh-edge") distances on a triangle mesh.geodesic_matrix_mesh
Minimum spanning tree over a subset of graph nodes, by geodesic distance.geodesic_mst_graph
Minimum spanning tree over a subset of mesh vertices, by geodesic distance.geodesic_mst_mesh
Distance to the nearest target for each source.geodesic_nearest
Distance to the nearest target vertex, for each source vertex of a mesh.geodesic_nearest_mesh
Geodesic distances for explicit pairs of nodes.geodesic_pairs
The shortest route from one source to each target, as node sequences.geodesic_path
Shortest path trees over a graph — distances _and_ the route to each node.geodesic_predecessors
Number of threads available for parallel work in this session.get_num_threads
Check whether the tree contains cycles.has_cycles
Heal a fragmented skeleton by reconnecting its fragments.heal_skeleton
Dendrogram leaf orderleaf_order
Connected components of every level set at once.level_set_components
The longest path from any node to its root.longest_path
The 'n' longest paths, each peeled off before the next is sought.longest_paths
Connected components of a triangle meshmesh_connected_components
Minimum (or maximum) spanning forest of an undirected graph.minimum_spanning_tree
The global affine of a moving least squares transformmls_affine
Build a moving least squares transform from landmark pairsmls_transform
Apply a moving least squares transform to pointsmls_xform
Forward NBLAST of every query neuron against every target neuron.nblast
All-by-all forward NBLAST.nblast_allbyall
Condensed distances from a score matrixnblast_dist
Hierarchical clustering of a score matrixnblast_hclust
k nearest neighbours under NBLAST, without building the score matrixnblast_knn
Forward NBLAST for a set of (query, target) index pairs.nblast_pairs
For each node ID in 'parents' find its index in 'nodes'.node_indices
Orient a graph into a rooted spanning forest — one parent per node.parents_from_edges
The path from each source up to its root.paths_to_root
Prune twigs below given threshold.prune_twigs
Re-orient a forest so that each of 'new_roots' becomes its component's root.reroot
Regenerate a parent vector after adding a set of undirected edges.reroot_rewire
Place nodes at a fixed spacing along every neurite.resample_skeleton
Set the number of threads used for parallel work in this session.set_num_threads
Simplify a triangle mesh, tracking where every vertex went.simplify_mesh
Simplify a triangle mesh without changing its shape.simplify_mesh_lossless
Drop the nodes that do not bend a neurite, by Ramer-Douglas-Peucker.simplify_rdp
Keep only roots, leafs and branch points, preserving cable length.simplify_skeleton
Drop the nodes that contribute least area, by Visvalingam-Whyatt.simplify_vw
The 'limit_dist="auto"' value for a scoring matrix.smat_auto_limit
Smooth a triangle meshsmooth_mesh
Smooth a skeleton with a moving average along each neurite.smooth_skeleton
Smooth a skeleton with a Gaussian kernel along each neurite.smooth_skeleton_gaussian
Find the minimal-length edges that reconnect the fragments of a skeleton.stitch_fragments
Calculate Strahler Index.strahler_index
Height of the subtree below each node.subtree_height
Symmetrise a score matrixsymmetrize
Synapse flow centrality for each node.synapse_flow_centrality
Forward syNBLAST of every query neuron against every target neuron.synblast
All-by-all forward syNBLAST over synapse clouds.synblast_allbyall
The affine part of a thin-plate splinetps_affine
Coefficients of a fitted thin-plate splinetps_coefs
Fit a thin-plate spline to landmark pairstps_transform
Apply a thin-plate spline to pointstps_xform
Walk directed half-edges into closed rings.trace_loops
Triangulate boundary rings, wound against the direction they run in.triangulate_rings
Unique undirected edges of a triangle mesh.unique_edges