morphonets / SNT

The ImageJ framework for quantification of neuronal anatomy
https://imagej.net/plugins/snt
GNU General Public License v3.0
42 stars 18 forks source link

Error saving SWCs from File menu when file path contains extra `.` before file extension #97

Closed carshadi closed 2 years ago

carshadi commented 2 years ago

Describe the bug If the output path contains extra periods . before the file extension, the exporter will incorrectly split the path at the first period. For example, if the Path I want to write to is: C:\Users\cameron.arshadi\Desktop\SNTData.swc

It will attempt to write the file: C:\Users\cameron-000.swc

image

To Reproduce File > Load Demo Dataset > Drosophila OP Neuron File > Save Tracings > SWC

However, saving swcs from a script, a la tree.saveAsSWC("C:\Users\cameron.arshadi\...") works as expected.

carshadi commented 2 years ago

found the issue, the prefix gets split twice. First time here https://github.com/morphonets/SNT/blob/a03001743be02b0d871fe6221f566fae9a313516/src/main/java/sc/fiji/snt/SNTUI.java#L4014-L4017

And then again when this method is called from the above method https://github.com/morphonets/SNT/blob/a03001743be02b0d871fe6221f566fae9a313516/src/main/java/sc/fiji/snt/PathAndFillManager.java#L455-L456

I'll submit a fix in a bit