zitmen / thunderstorm

ThunderSTORM: a comprehensive ImageJ plugin for SMLM data analysis and super-resolution imaging
http://zitmen.github.io/thunderstorm/
GNU General Public License v3.0
91 stars 42 forks source link

Unrecognized character in chi2 column for merged localizations causes import failure #47

Closed cleterrier closed 7 years ago

cleterrier commented 7 years ago

ThunderSTORM (latest build from 07-27-16), latest Fiji (ImageJ 1.51f) under Java 8 (102) on OSX El Capitan (10.11.5).

When merging localizations in the results table, the merged localizations (detections >1) are assigned a character as the chi2 value that is not recognized and appears as a question mark inside a losange (see attached screenshot). When exporting a localization file (as csv in my case), this unrecognized character prevents importing the localization file again, with the following import failure:

(Fiji Is Just) ImageJ 2.0.0-rc-52/1.51f; Java 1.8.0_102 [64-bit]; Mac OS X 10.11.5; 76MB of 19932MB (<1%)

java.lang.NumberFormatException: For input string: "�"
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
    at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    at java.lang.Double.parseDouble(Double.java:538)
    at cz.cuni.lf1.lge.ThunderSTORM.ImportExport.DLMImportExport.importFromFile(DLMImportExport.java:81)
    at cz.cuni.lf1.lge.ThunderSTORM.ImportExportPlugIn.callImporter(ImportExportPlugIn.java:266)
    at cz.cuni.lf1.lge.ThunderSTORM.ImportExportPlugIn.runImport(ImportExportPlugIn.java:123)
    at cz.cuni.lf1.lge.ThunderSTORM.ImportExportPlugIn.run(ImportExportPlugIn.java:87)
    at ij.IJ.runUserPlugIn(IJ.java:217)
    at ij.IJ.runPlugIn(IJ.java:181)
    at ij.Executer.runCommand(Executer.java:137)
    at ij.Executer.run(Executer.java:66)
    at java.lang.Thread.run(Thread.java:745)
cleterrier commented 7 years ago

It's also happening under Windows.

I guess the problem comes from the NaN value assigned here: https://github.com/zitmen/thunderstorm/blob/7f978b7f88fa04e97cdf0866d64777798d2c9a93/src/main/java/cz/cuni/lf1/lge/ThunderSTORM/estimators/PSF/MoleculeDescriptor.java#L742

cleterrier commented 7 years ago

By the way it's only happening with methods other than Maximum Likelihood (as ML does not output a chi2 column)