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

Failed to save the path as .swc file #147

Closed
ruiwang1127 opened this issue Feb 17, 2023 · 6 comments
Closed

Failed to save the path as .swc file #147

ruiwang1127 opened this issue Feb 17, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@ruiwang1127
Copy link

Describe the bug
Failed to save the path as .swc file

To Reproduce
Steps to reproduce the behavior:

  1. finish the tracing and select

  2. file-save tracing-swc

  3. .swc saved but this .swc file cannot be loaded properly
    image
    image

  4. when save as .traces, everything looks fine in SNT

  5. also tried the batch converter in script: convert correctly-loadable .trace files to .swc, then if I try to open the swc files, same error appears

Expected behavior
.swc files correctly saved and can be analized by other softwares.

Fiji details (If possible, please paste here the contents of Plugins>Debug>System Information):
system info.txt

@ruiwang1127 ruiwang1127 added the bug Something isn't working label Feb 17, 2023
@carshadi
Copy link
Member

Hi @ruiwang1127 , thanks for the report. That seems odd, would you be able to post the .swc and .traces files here?

@ruiwang1127
Copy link
Author

Hi @ruiwang1127 , thanks for the report. That seems odd, would you be able to post the .swc and .traces files here?

Hi there,

please see attached files. I also put the input tiff file there. Many thanks.
input.zip

Rui04012023.zip

@carshadi
Copy link
Member

Thanks! I suspect the issue is that the floating point values in the swc have commas instead of periods for the decimal, which is super strange...

# Exported from SNT v4.1.13 on 2023-02-17T11:49:08.293
# https://imagej.net/SNT
#
1	0	967,000000 972,000000 17,000000 0,000000	-1
2	0	966,000000 972,000000 16,000000 0,000000	1
3	0	965,000000 972,000000 16,000000 0,000000	2

When I trace and export an swc on the same image, I get the expected floating point format

# Exported from SNT v4.1.14-SNAPSHOT on 2023-02-20T09:42:53.638
# https://imagej.net/SNT
#
# All positions and radii in micrometer
# Voxel separation (x,y,z): 1.0, 1.0, 1.0
#
1	0	196.000000 148.000000 27.000000 0.000000	-1
2	0	197.000000 149.000000 26.000000 0.000000	1
3	0	198.000000 150.000000 26.000000 0.000000	2
4	0	199.000000 151.000000 26.000000 0.000000	3
5	0	200.000000 152.000000 26.000000 0.000000	4

I have never seen this happen before, @tferr do you have any ideas? Could it be something about European computers using a different format??

@tferr
Copy link
Member

tferr commented Feb 20, 2023

Yes, must be related to the locale. @ruiwang1127, I am assuming your computer is set to a language that uses a comma as a decimal separator?
A while ago we had someone suggesting to respect the locale in dialog input fields (I think they were using European french), so we change the way we parse strings to allow for that. I guess that change is also being used when saving SWCs.

Either way, it is a bug. I will try to look into it this week. I propose we use only periods (.) when saving SWC files, as I think that is the norm. @carshadi, agree?

@carshadi
Copy link
Member

that makes sense to me

@tferr
Copy link
Member

tferr commented Feb 21, 2023

@ruiwang1127, could you please run Fiji's updater and try SNT4.1.14, which was just released. I am convinced it fixes this issue. Unfortunately, it won't fix any pre-existing files that you may have using comma delimiters. Let us know if you need help re-importing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants