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

When running drift correction in a macro, the macro continues without waiting for the process to be finished #16

Closed zitmen closed 9 years ago

zitmen commented 9 years ago
What steps will reproduce the problem?
1. Execute the following macro, with valid in_path for a ThnuderSTORM csv path, and
out_path

run("Import results", "append=false startingframe=1 rawimagestack= filepath=[in_path]
livepreview=false fileformat=[CSV (comma separated)]");
run("Show results table", "action=drift magnification=5 save=false showcorrelations=false
method=[Cross correlation] steps=5");
print("Macro goes on!");
run("Export results", filepath=[out_path] fileformat=[CSV (comma separated)]
sigma1=true sigma2=true intensity=true saveprotocol=false id=false frame=true bkgstd=true
uncertainty_z=true offset=true detections=true z=true y=true uncertainty=true x=true");

What is the expected output? What do you see instead?
The loc file should be opened then processed for drift correction, the print message
displayed only after processing is finished, then the corrected loc file saved. Instead
the macro goes on before the end of the drift correction processing.

What version of the product are you using? On what operating system?
Oct. 28 daily build

Please provide any additional information below.

Original issue reported on code.google.com by lechristophe on 2014-11-05 13:01:28

zitmen commented 9 years ago
The issue was fixed in revision 7e471c3ad5e9.
The post-processing might be time consuming at times. That's why the operations are
performed in separated thread so the user interface is not blocked.
Newly, if an  operation is called from a macro, the operation is performed in the main
thread, so the macro waits until the operation is completed.

New daily build is available.

Original issue reported on code.google.com by zitmen on 2014-11-06 01:43:32

zitmen commented 9 years ago
Works perfectly, thanks! Will the unique-thread option be triggered also in javascripts?

Original issue reported on code.google.com by lechristophe on 2014-11-06 10:10:23

zitmen commented 9 years ago
Yes, this is language independent. Any macro will trigger this feature, unless you want
to go around this and call some function directly.

In JS macro, you can use IJ.run() function and it will work.

Original issue reported on code.google.com by zitmen on 2014-11-06 10:24:12

zitmen commented 9 years ago
Good to know, thanks. Speaking of calling functions directly, is there an API online
for ThunderSTORM? I built one from the source using javadoc, but I was wondering if
there was one from you available.

Original issue reported on code.google.com by lechristophe on 2014-11-06 11:01:04

zitmen commented 9 years ago
Unfortunately, there isn't. Honestly, it never even came into our mind that parts of
ThunderSTORM could be used as a library, although it is written so the parts of the
code can be reused. Javadoc is the only available source of information and if you
already looked into it, you know that it is quite incomplete, because we have commented
mainly parts that might be confusing to us as developers. There is still many thinks
that could be further improved (documentation, unit tests, availability, new features,
etc.), but we currently don't have enough resources to concentrate on all of it.

If you are interested in using some particular feature programatically, you can always
contact me via email or rather use the discussion group and I can help, if I know how
:)

Original issue reported on code.google.com by zitmen on 2014-11-06 13:54:48