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
95 stars 42 forks source link

Problem encountered with Merging during analysis #25

Closed kmdouglass closed 9 years ago

kmdouglass commented 9 years ago

Hello, I always receive a java.lang.IndexOutOfBoundsException when trying to use the Merging feature of ThunderSTORM analysis tools. I am using ThunderSTORM 1.3-2014-11-08 and FIJI/ImageJ 1.49c.

I use a custom-built program to perform the localization steps on the image stacks recorded by our camera. Then, I write the column names and output to a comma-delimited file which I import into ThunderSTORM using Import/Export > Import results. The results table opens without problems and I can perform filtering based on columns and visualize the data, but when I try to merge the localizations the following Exception is raised:

(Fiji Is Just) ImageJ 2.0.0-rc-8/1.49c; Java 1.6.0_24 [64-bit]; Windows 7 6.1; 66MB of 24496MB (<1%)

java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Should be at least 0 and less than 9, found 9
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at javax.swing.SwingWorker.get(SwingWorker.java:582)
    at cz.cuni.lf1.lge.ThunderSTORM.util.WorkerThread$1.done(WorkerThread.java:49)
    at javax.swing.SwingWorker$5.run(SwingWorker.java:717)
    at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:814)
    at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:95)
    at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:824)
    at javax.swing.Timer.fireActionPerformed(Timer.java:291)
    at javax.swing.Timer$DoPostEvent.run(Timer.java:221)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642)
    at java.awt.EventQueue.access$000(EventQueue.java:85)
    at java.awt.EventQueue$1.run(EventQueue.java:603)
    at java.awt.EventQueue$1.run(EventQueue.java:601)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:612)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.IndexOutOfBoundsException: Should be at least 0 and less than 9, found 9
    at org.apache.commons.collections.primitives.ArrayDoubleList.checkRange(ArrayDoubleList.java:249)
    at org.apache.commons.collections.primitives.ArrayDoubleList.get(ArrayDoubleList.java:118)
    at cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.Molecule.getParam(Molecule.java:138)
    at cz.cuni.lf1.lge.ThunderSTORM.results.FrameSequence.InsertMolecule(FrameSequence.java:36)
    at cz.cuni.lf1.lge.ThunderSTORM.results.ResultsGrouping.getMergedMolecules(ResultsGrouping.java:159)
    at cz.cuni.lf1.lge.ThunderSTORM.results.ResultsGrouping$1.doJob(ResultsGrouping.java:107)
    at cz.cuni.lf1.lge.ThunderSTORM.results.ResultsGrouping$1.doJob(ResultsGrouping.java:104)
    at cz.cuni.lf1.lge.ThunderSTORM.util.WorkerThread$1.doInBackground(WorkerThread.java:43)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at javax.swing.SwingWorker.run(SwingWorker.java:316)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

I get this error regardless of the Merging parameters I enter. (In this case I tried a maximum distance of 50, a Max. frames per molecule of 10, and a Max. off frames of 1.)

I suspect that the problem is with the formatting of the column names because there are 9 columns and the index error mentions that it received an index of 9. Unfortunately, I cannot find any advice in the documentation for how to format the header. I would be happy to e-mail the localization file to you directly if it would help diagnose the problem.

Thanks! Kyle

zitmen commented 9 years ago

Data: https://goo.gl/7WfIHO

zitmen commented 9 years ago

I've found out that changing the header to x [nm],y [nm],z [nm],frame,sigma [nm],intensity [photon],bkgstd [photon],loglikelihood [no units], i.e., remove spaces between column labels makes it work. But unfortunatelly no actual error in the code has been found, because the case with spaces is already handled. Also after recompiling the plugin it seems to work even with the spaces. There might be some inconsistency caused by compilation New daily build (dev-2015-08-02-b1) will be released today so when that happens, I would recommend you to update. If the problem still occurs after the update, let me know by posting in the discussion group (https://groups.google.com/forum/#!topic/thunderstorm-users/H1iughpp3Sc).