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

.swc file of skeletons is empty #507

Closed
smcelroy97 opened this issue Jun 22, 2023 · 20 comments
Closed

.swc file of skeletons is empty #507

smcelroy97 opened this issue Jun 22, 2023 · 20 comments

Comments

@smcelroy97
Copy link

I am trying to export .swc files from a segmented EM dataset of neuron skeletons. For both options (save as um and save as px) the swc file contains zero bytes and is empty.

@my-tien
Copy link
Member

my-tien commented Jun 24, 2023

Hi, the swc export does not work on segmentation, it exports KNOSSOS skeletons into swc format. Since conversion from segmentation to skeleton can have multiple possible solutions depending on the input we have so far not implemented this feature.

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 26, 2023 via email

@my-tien
Copy link
Member

my-tien commented Jun 26, 2023

No, as long as you have a skeleton with nodes inside, that should be enough. Do you mind sharing the skeleton here? Or any dummy skeleton that doesn't work for you.

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 27, 2023 via email

@my-tien
Copy link
Member

my-tien commented Jun 27, 2023

Yes, exactly

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 27, 2023 via email

@my-tien
Copy link
Member

my-tien commented Jun 27, 2023

You seem to have forgotten the attachment

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 27, 2023 via email

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 28, 2023 via email

@my-tien
Copy link
Member

my-tien commented Jun 28, 2023

Unfortunately no. Alternatively, you could also choose export to nml instead of saving to kzip. Then you can open the saved file in any text editor and copy-paste us the content per email.

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 29, 2023 via email

@my-tien
Copy link
Member

my-tien commented Jun 29, 2023

Okay, so the issue is that none of your trees contain any nodes. So there isn't really anything to export.
Could you explain what you are trying to achieve?

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 29, 2023 via email

@my-tien
Copy link
Member

my-tien commented Jun 29, 2023

There are 3 formats that can be exported from KNOSSOS. Below you can see how they look like and how to export them. Since in your case no skeleton data has been created, you will get the best impression of the morphology by going for the mesh:

1. Skeleton data

a graph with vertices and optionally edges, can be exported as .swc
image

2. Segmentation

a pixel/voxel-labeling that is visualized as colored areas/volumes. Can be converted to numpy matrices with https://github.com/knossos-project/knossos_utils
image

3. Mesh

a 3D surface. After saving as .k.zip, there will be a .ply file within the .k.zip that you can extract and open in any 3D viewer such as Blender or Meshlab.
image

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 29, 2023 via email

@my-tien
Copy link
Member

my-tien commented Jun 29, 2023

Yes, almost. This is what I hinted at in my first message: There is no trivial solution for a conversion from segmentation to skeleton because every small bump in the segmentation could in theory be turned into a branch of the skeleton. There are algorithms like skeletonize_3d from scikit-image or maybe you can have a look at https://github.com/seung-lab/kimimaro (haven't worked with it myself yet).

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 29, 2023 via email

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 30, 2023 via email

@smcelroy97
Copy link
Author

smcelroy97 commented Jun 30, 2023 via email

@my-tien my-tien closed this as completed Jun 30, 2023
@my-tien
Copy link
Member

my-tien commented Jun 30, 2023

Please file an issue over at https://github.com/knossos-project/knossos_utils for this.

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

No branches or pull requests

2 participants