You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for your work!
I am a new at this , and I am trying to get the skeleton for animation from a mesh. I've run this code and get result like the left one in this picture, which have much more joints than I need. How can I get the right result in this picture?
Can you give some advice on this? thank you very much!
The text was updated successfully, but these errors were encountered:
Simplifying or downsampling the skeleton is not terribly difficult but there is currently no convenience method built directly into skeletor. I will have a think about whether to add one.
# Run the example skeletonization>>>importskeletorassk>>>mesh=sk.example_mesh()
>>>fixed=sk.pre.fix_mesh(mesh, remove_disconnected=5, inplace=False)
>>>skel=sk.skeletonize.by_wavefront(fixed, waves=1, step_size=1)
# Turn the skeletor object into navis >>>importnavis>>>n=navis.TreeNeuron(skel, soma=None)
>>>n.n_nodes# Number of nodes/vertices1103# Option 1: downsample by given factor# Note that his will never remove branch or end points which means # there is a limit to how much you can downsample>>>ds=navis.downsample_neuron(n, downsampling_factor=10)
>>>ds.n_nodes# Check that we now have fewer nodes/vertices500# Option 2: resample to given segment length# This also works to "upsample" the skeleton>>>res=navis.resample_skeleton(n, resample_to=1000)
>>>res.n_nodes# Check that we now have fewer nodes/vertices517# Turn navis object to skeletor Skeleton>>skel2=sk.Skeleton(ds.nodes[['node_id', 'parent_id', 'x', 'y', 'z', 'radius']].copy())
A potential catch here is that by downsampling you break the correspondence between the vertices in your original mesh and the nodes in the skeleton.
Hi, thanks for your work!
I am a new at this , and I am trying to get the skeleton for animation from a mesh. I've run this code and get result like the left one in this picture, which have much more joints than I need. How can I get the right result in this picture?
Can you give some advice on this? thank you very much!
The text was updated successfully, but these errors were encountered: