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

Increasing resolution of the vertex positions to sub-voxel level #91

Open
RomStriker opened this issue Sep 29, 2024 · 3 comments
Open
Labels
feature New feature or request

Comments

@RomStriker
Copy link

Hi,

Thanks for the great work. I am using Kimimaro to get the centerline of Lung airway trees from the ATM'22 dataset. Is there a way to increase the resolution of the positions of each vertex from the voxel level to the sub-voxel level like 0.1 voxel? For example, I have extracted the centerline trees, using Kimimaro and Slicer3D's VMTK centerline extraction toolkit, in the image the green graph is from Kimimaro and the purple is from VMTK.
image
As you can see the VMTK is much smoother due to the higher resolution vertex positions, while the Kimimaro output seems to jump around. I want to use Kimimaro as it is much faster, robust, and manages to capture more branches, but it would be great if it could also produce positions with higher resolution. I tried to increase the resolution using the argument 'anisotropy=(16,16,16)' such that each voxel has a spatial resolution of 16, but it resulted in the original positions times 16. Any help would be appreciated.

@william-silversmith
Copy link
Contributor

Hi! I'm not sure there are fantastic options for getting the same result using Kimimaro, they are different algorithms. The vibrations come from finding the shortest path across a penalty field which includes all 26 possible directions of motion.

A possible remedy would be to apply a smoothing filter to the Kimimaro output. I wrote a moving average smoothing filter and uploaded it to the master branch of CloudVolume's Skeleton class (that Kimimaro outputs):

https://github.com/seung-lab/cloud-volume/blob/master/cloudvolume/skeleton.py#L929-L963

Give that a try and see if that does what you need. The main downside is that this simple operation can't guarantee that points will remain inside the object (though it could make use of radius information to do so actually... I'll have to think about this).

@william-silversmith
Copy link
Contributor

william-silversmith commented Sep 29, 2024

Here's some before and after pics using n=3 vertices and n=5 vertices

original
image

n=3
image

n=5
image

@william-silversmith william-silversmith added the feature New feature or request label Oct 1, 2024
@william-silversmith
Copy link
Contributor

This is released in version 11.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants