Closed Hailey-Liu closed 5 years ago
Hi HaominIsMe!
I think this is a bit difficult to answer without seeing a representation of the space you are trying to skeletonize. Can you post what scale and const values you tried? Is your data isotropic (meaning all axes have the same dimension)?
Thanks! Will
Also, if you haven't seen them, check out these tutorials that might help you understand what's going on:
https://github.com/seung-lab/kimimaro/wiki/Intuition-for-Setting-Parameters-const-and-scale https://github.com/seung-lab/kimimaro/wiki/A-Pictorial-Guide-to-TEASAR-Skeletonization
The space is generated with small shape(64, 64, 64), and I would like to skeleton the voxels with label 1. I check the tutorials explaining scale and const, which I set scale=10, const=0
based on my understanding.
Here is how I did:
import kimimaro
labels = np.load('structure.npy')
labels = labels.astype(int)
skels = kimimaro.skeletonize(
labels,
teasar_params={
'scale': 10,
'const': 0, # physical units
}
)
Please unzip the attachment for the structure file. structure.npy.zip
Thanks for the data, that's very helpful!
I ran the following code and got this output:
import numpy as np
from cloudvolume import *
import kimimaro
img = np.load('structure.npy')
img = img.astype(np.uint8)
skels = kimimaro.skeletonize(
img,
teasar_params={
'scale': 1.5,
'const': 3,
},
anisotropy=(1,1,1),
fix_branching=True,
fix_borders=True,
)
skels[1].viewer()
Is this more what you're looking for?
You can also visualize your data a bit better like this:
from cloudvolume import view
import numpy as np
img = img.astype(np.bool)
view(img)
Hi @william-silversmith
Yes. This is exactly what I am looking for. Thanks for your help.
Awesome! Glad I could help.
Hello kimimaro users,
I am very new to kimimaro. I am trying to use the
kimimaro.skeletonize()
to skeletonize my stochastic structure. I didn't specify any of theteasar_params
and it returns the skeleton with hollow inside, as the screenshot showed. I tried to tunescale
andconst
, but it still not solve the issue. Could I have some suggestions from you?