Closed liuyx599 closed 1 year ago
Hi liuyx599,
Thank you for persisting and figuring out the issue! You make a good point, it should be possible to annotate at least some of the points using radius and structural information. This is something we could add. Endpoints in particular are very easy.
However, one reason we strip the vertex_types when making neuroglancer compatible skeletons is (afaik) neuroglancer doesn't support integer vertex attributes. Once that is fixed, we can stop stripping them.
Thanks for your reply! So kimimaro, like teaser, does not generate node type information during the skeletonization process? I now have a simple idea to speak about nodes of degree 1 (leaf nodes) and root nodes as endpoints of the skeleton, which can be achieved with the help of navis as follows:
skel = navis.read_swc(".\segment_45.swc")
skel.leafs
Out[8]:
node_id label x y z radius parent_id type
99 104 0 2328.0 2088.0 2970.0 107.331261 103 end
221 226 0 5256.0 3192.0 2970.0 24.000000 225 end
225 79 0 1824.0 1968.0 2970.0 53.665630 78 end
If kimimaro can't automatically determine the type of these nodes, I can't think of a better way to determine the endpoints
Hi! Navis is definitely more sophisticated, but the Skeleton class used in Igneous, CloudVolume, and Kimimaro does have the capability to compute terminal and branch nodes. We could augment the SWC generator with this information.
https://github.com/seung-lab/cloud-volume/blob/master/cloudvolume/skeleton.py#L308-L322
skel.terminals()
skel.branches()
This is very cool, and it seems to be consistent with navis' results, where cloud-volume's terminals are equivalent to navis' leafs plus root
I now know that it seems to be possible to get the corresponding skeleton and convert it to swc by cloudvolume, but I seem to have some bugs
then there is bug
but the skeleton is not empty
Ok, when I wrote this issue I seem to have solved the bug, I need to manually set the type of these nodes
By the way, can't Igneous discern the node type of the skeleton using kimimaro's skeletonization method? For example, endpoint, soma, etc.? If I want to determine that a node is an endpoint, do you have a better suggestion?