|
Bugzilla – Bug 630 |
running QuickPALM gives an error |
Last modified: 2013-07-13 14:15:51 CDT |
| ⚠ |
NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug. The Fiji project now uses GitHub Issues for issue tracking. Please file all new issues there. |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|||||
I am using ImageJ/fiji on the cluster through the command line (in a headless mode - without GUI). I installed QuickPalm plug-in manually by typing: ./Build.sh plugins/QuickPALM_.jar When I try to use plugin in the script (example: run("Analyse Particles", "minimum=2 maximum=4 image=127..";), it gives me an error: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at ij.Command.runPlugIn(Command.java:148) at ij.Command.runCommand(Command.java:97) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:260) at ij.macro.Functions.doRun(Functions.java:589) at ij.macro.Functions.doFunction(Functions.java:89) at ij.macro.Interpreter.doStatement(Interpreter.java:219) at ij.macro.Interpreter.doBlock(Interpreter.java:553) at ij.macro.Interpreter.doStatement(Interpreter.java:255) at ij.macro.Interpreter.doFor(Interpreter.java:499) at ij.macro.Interpreter.doStatement(Interpreter.java:237) at ij.macro.Interpreter.doStatements(Interpreter.java:207) at ij.macro.Interpreter.run(Interpreter.java:104) at ij.macro.Interpreter.run(Interpreter.java:74) at ij.macro.Interpreter.run(Interpreter.java:85) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:123) at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:107) at ij.IJ.runMacroFile(IJ.java:127) at ij.ImageJ.main(ImageJ.java:683) at fiji.Main.main(Main.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at imagej.ClassLauncher.launch(ClassLauncher.java:224) at imagej.ClassLauncher.run(ClassLauncher.java:161) at imagej.ClassLauncher.main(ClassLauncher.java:72) Caused by: java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159) at java.awt.Window.<init>(Window.java:432) at java.awt.Frame.<init>(Frame.java:403) at java.awt.Frame.<init>(Frame.java:368) at ij.io.SaveDialog.save(SaveDialog.java:183) at ij.io.SaveDialog.<init>(SaveDialog.java:35) at QuickPALM.ParticleSaver.setup(ParticleSaver.java:35) at QuickPALM.MyDialogs.analyseParticles(MyDialogs.java:392) at QuickPALM.Analyse_Particles.run(Analyse_Particles.java:29) at ij.IJ.runUserPlugIn(IJ.java:194) at ij.IJ.runPlugIn(IJ.java:160) ... 31 more Does this mean that QuickPALM does not support headless mode or I did not install it properly? P.S.: In my script I do specify that I am running macros in headless mode with the build-in function: setBatchMode(true).The funny thing is: if I run this little macro (because I have no images to test... maybe you want to make it easier for me to reproduce your problem by providing me with a small sample image and a macro that triggers the error on your side?) -- snip -- run("Blobs (25K)", ""); run("Analyse Particles", "minimum=5 maximum=4 image=106 smart oonline stream file=[/home/gene099/Particles Table.xls] pixel=30 accumulate=0 update=10 _image=imgNNNNNNNNN.tif start=0 in=50 _minimum=0 local=20 _maximum=1000 threads=50"); -- snap -- it shows a completely different error message: -- snipsnap -- java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at ij.Command.runPlugIn(Command.java:148) at ij.Command.runCommand(Command.java:97) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:265) at ij.IJ.run(IJ.java:316) at QuickPALM.ReconstructionViewer.<init>(ReconstructionViewer.java:59) at QuickPALM.Analyse_Particles.run(Analyse_Particles.java:65) at ij.IJ.runUserPlugIn(IJ.java:195) at ij.IJ.runPlugIn(IJ.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at ij.Command.runPlugIn(Command.java:148) at ij.Command.runCommand(Command.java:97) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:265) at ij.macro.Functions.doRun(Functions.java:589) at ij.macro.Functions.doFunction(Functions.java:89) at ij.macro.Interpreter.doStatement(Interpreter.java:219) at ij.macro.Interpreter.doStatements(Interpreter.java:207) at ij.macro.Interpreter.run(Interpreter.java:104) at ij.macro.Interpreter.run(Interpreter.java:74) at ij.macro.Interpreter.run(Interpreter.java:85) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:123) at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:107) at ij.IJ.runMacroFile(IJ.java:127) at ij.ImageJ.main(ImageJ.java:683) at fiji.Main.main(Main.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at imagej.ClassLauncher.launch(ClassLauncher.java:224) at imagej.ClassLauncher.run(ClassLauncher.java:161) at imagej.ClassLauncher.main(ClassLauncher.java:72) Caused by: java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) at java.awt.Button.<init>(Button.java:152) at ij.plugin.filter.ScaleDialog.makeButtonPanel(ScaleDialog.java:116) at ij.plugin.filter.ScaleDialog.run(ScaleDialog.java:63) at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:262) at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:111) at ij.IJ.runPlugIn(IJ.java:168) ... 40 more java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at ij.Command.runPlugIn(Command.java:148) at ij.Command.runCommand(Command.java:97) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:265) at ij.IJ.run(IJ.java:316) at QuickPALM.ReconstructionViewer.<init>(ReconstructionViewer.java:59) at QuickPALM.Analyse_Particles.run(Analyse_Particles.java:65) at ij.IJ.runUserPlugIn(IJ.java:195) at ij.IJ.runPlugIn(IJ.java:160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at ij.Command.runPlugIn(Command.java:148) at ij.Command.runCommand(Command.java:97) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:265) at ij.macro.Functions.doRun(Functions.java:589) at ij.macro.Functions.doFunction(Functions.java:89) at ij.macro.Interpreter.doStatement(Interpreter.java:219) at ij.macro.Interpreter.doStatements(Interpreter.java:207) at ij.macro.Interpreter.run(Interpreter.java:104) at ij.macro.Interpreter.run(Interpreter.java:74) at ij.macro.Interpreter.run(Interpreter.java:85) at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:123) at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:107) at ij.IJ.runMacroFile(IJ.java:127) at ij.ImageJ.main(ImageJ.java:683) at fiji.Main.main(Main.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at imagej.ClassLauncher.launch(ClassLauncher.java:224) at imagej.ClassLauncher.run(ClassLauncher.java:161) at imagej.ClassLauncher.main(ClassLauncher.java:72) Caused by: java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) at java.awt.Button.<init>(Button.java:152) at ij.plugin.filter.ScaleDialog.makeButtonPanel(ScaleDialog.java:116) at ij.plugin.filter.ScaleDialog.run(ScaleDialog.java:63) at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:262) at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:111) at ij.IJ.runPlugIn(IJ.java:168) ... 40 moreThis is not so much a problem of Fiji, but a security measure unknown to Windows users: files that are downloaded on Linux or MacOSX are never marked as executable. You will have to do that yourself, e.g by using the command-line chmod a+x <the-downloaded-file>There is no Upload Images in Help. Unfortunately, the limit for the attachment here is 5 MB, and my smallest image is 546 MB. Is there any other way to send it to you? The script below is the macros that I used: setBatchMode(true); dir = '/yourDirectoryHere/'; list = getFileList(dir); Array.print(list); for (i=0; i<list.length; i++) { open(dir+list[i]); run("Split Channels"); close(); selectWindow("C1-"+list[i]); saveAs("Tiff", dir+"C1-"+list[i]); run("Analyse Particles", "minimum=2 maximum=4 image=127 smart online pixel=20 accumulate=0 update=100 _image=imgNNNNNNNNN.tif start=0 in=50 _minimum=0 local=20 _maximum=1000 threads=50"); selectWindow("C1-"+(i+1)+" Reconstruction"); saveAs("Tiff", dir+"C1-"+(i+1)+" Reconstruction"); close(); } I am not sure whether it will be of any use since you do not have my sample...Created attachment 108 A very small subset of the example image, just enough to reproduce the problemProgress: I can now start the macro by just adding a " file=[/path/to/file]" that specifies where the results should be saved to. So my minimal macro now looks like this: -- snip -- open("/tmp/small-2.tif"); run("Analyse Particles", "minimum=2 maximum=4 image=127 smart online pixel=20 accumulate=0 update=100 _image=imgNNNNNNNNN.tif start=0 in=50 _minimum=0 local=20 _maximum=1000 threads=50 file=[/tmp/olex.txt]"); -- snap -- I also fixed a bug in QuickPALM that shows only with small files (see the mail I just sent to Ricardo, you Cc:ed to keep you in the loop). Now on to figure out why the macro recorder forgot to record the "file" parameter.Yes, I just kept fewer than the original 710 frames because the only thing I needed to reproduce was the error you reported, not the complete procedure. And for that, 32 slices were quite plenty (and very fast to process, I might add). So here are good and bad news. The bad news are: when I record a macro using the QuickPALM "Analyse Particles", I get something like this: -- snip -- run("Analyse Particles", "minimum=5 maximum=4 image=106 smart online stream file=[/tmp/Downloads/Particles Table.xls] pixel=30 accumulate=0 update=10 _image=imgNNNNNNNNN.tif start=0 in=50 _minimum=50 local=20 _maximum=1000 threads=50"); -- snap -- Do you notice the "file=[...]" part? This is what was lacking from the macro as presented in comment 14. The good news is that there is no bug I need to fix; I have no idea whether this was a bug in the ImageJ version you used for recording, but at least in 1.47t it works correctly.