-
Notifications
You must be signed in to change notification settings - Fork 26
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
Plotting issues #41
Comments
Hi! Glad your skeleton seems to have turned out OK. Under the hood, I can't quite tell from your example whether you are using I don't think I can help you with |
Thanks for the super quick reply! I'm currently plotting the original mesh in pyvista and then use your code to plot the skeleton and the mesh (but that doesn't work for me completely). I eventually want to click on the points of which the skeleton is made. Maybe instead of using |
In the end You can always get the points and save them yourself: >>> import skeletor as sk
>>> 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)
>>> skel
<Skeleton(vertices=(1258, 3), edges=(1194, 2), method=wavefront)>
>>> # Get the points as (N, 3) numpy array
>>> skel.vertices
array([[ 3458.71940104, 21792.08268229, 15101.31347656],
[ 3521.65361328, 21865.68359375, 15115.18046875],
[ 3636.05541992, 21930.08447266, 15149.98095703],
...,
[22080.08691406, 23342.10595703, 24558.125 ],
[22037.41959635, 23518.77571615, 24649.29264323],
[22076.88671875, 23217.7046875 , 24472.12304688]])
>>> # Get the corresponding (M, 2) edges
>>> skel.edges
array([[ 1, 0],
[ 2, 1],
[ 3, 5],
...,
[1100, 1102],
[1101, 1100],
[1102, 1097]])
>>> # Get the SWC table as pandas DataFrame
>>> skel.swc.head()
node_id parent_id x y z radius
0 0 -1 3458.719401 21792.082682 15101.313477 59.041832
1 1 0 3521.653613 21865.683594 15115.180469 89.220330
2 2 1 3636.055420 21930.084473 15149.980957 82.838492
3 3 5 3481.386393 20677.398437 16057.328125 82.052557
4 4 2 3726.056763 21988.085449 15177.981689 81.357745 Using the |
|
|
Correct |
Hi,
I'm having some issues with plotting the skeleton.
I'm using python 3.9.7 and I've managed to get the skeleton from one of my own .STL files.
`mesh = tm.load_mesh(file_path)
plotter = pv.Plotter()
plotter.add_mesh(mesh)
plotter.show()
#fixed = sk.pre.fix_mesh(mesh, remove_disconnected=5, inplace=False)
skel = sk.skeletonize.by_wavefront(mesh, waves=1, step_size=1)
skel.show(mesh=True)`
This is the original mesh:
This is the result of the skeletonization:
I'm currently having the issues that under a lot of camera angles, the skeleton and mesh are not showing at all. I have to randomly turn the camera and hope they appear. The mesh is also not showing for 99%. I do get this warning from python:
UserWarning: Could not set COM MTA mode. Unexpected behavior may occur. warnings.warn("Could not set COM MTA mode. Unexpected behavior may occur.")
Is this related to my problem and is there a way to solve it?The text was updated successfully, but these errors were encountered: