Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Better wavefront method #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

[WIP] Better wavefront method #49

wants to merge 4 commits into from

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 propagates exactly a user-defined distance along the mesh 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.

1 participant