Skip to content

Conversation

@schlegelp
Copy link
Collaborator

@schlegelp schlegelp commented Jul 29, 2024

This PR adds a modified version of the wavefront skeletonization in which the wave travels exactly a user-defined distance along the edges of the mesh at each step instead of hopping from vertex to vertex.

Advantages

  • works much better on coarse meshes or meshes with inhomogenous details

Disadvantages

  • computationally more expensive (this still needs testing; I also haven't spent any time optimising)
  • because this doesn't operate directly on the vertices (but rather the edges between them) there is no 1:1 correspondence between mesh vertices and skeleton nodes (i.e. no mesh_map); we could generate an approximation but that would need to be both ways (vertex -> node and node -> vertex)

Here is a quick and dirty example using one of the navis example neurons:

>>> import navis
>>> import skeletor as sk
>>> mesh = sk.pre.fix_mesh(navis.example_neurons(1, kind='mesh').trimesh, remove_disconnected=20)
>>> # New method moving exactly 50 units at each step
>>> s = sk.skeletonize.by_wavefront_exact(mesh, step_size=50)

wavefront_example

Arrows highlight areas where the exact method (yellow) does better than the original (red) method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants