Dear colleagues,
I ran into a small macro problem specific to FIJI, but which may be identified by ImageJ users as well. When I want to run a quick re-measurement of a ROI set, I use the following code (now with some sample ROIs): setBatchMode(true); // run("Clear Results"); roiManager("reset"); newImage("test","8-bit black",512,512,1);id=getImageID; makeRectangle(57, 95, 47, 42);roiManager("Add"); makeRectangle(152, 159, 33, 37);roiManager("Add"); makeRectangle(61, 238, 60, 55);roiManager("Add"); roiManager("deselect");run("Select None"); roiManager("measure"); selectImage(id);close; setBatchMode(false); However, when I want to do this in an automated fashion on various ROI sets and assure the results table is empty so will not be appended, I run into trouble when including the run("Clear Results"); command. The results table stays empty (if it is open) and the Fiji status bar says the test image is locked. The script editor returns the following error: Started Macro.ijm at Tue Apr 03 12:05:27 CEST 2012 java.lang.NullPointerException: null at ij.plugin.filter.Analyzer.saveResults(Analyzer.java:409) at ij.plugin.filter.Analyzer.measure(Analyzer.java:241) at ij.plugin.filter.Analyzer.run(Analyzer.java:88) at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:256) at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:105) at ij.IJ.runPlugIn(IJ.java:158) at sun.reflect.GeneratedMethodAccessor9.invoke(null:-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at ij.Command.runPlugIn(Command.java:146) at ij.Command.runCommand(Command.java:95) at ij.Executer.run(Executer.java:64) at ij.IJ.run(IJ.java:249) at ij.IJ.run(IJ.java:227) at ij.plugin.frame.RoiManager.measure(RoiManager.java:786) at ij.plugin.frame.RoiManager.runCommand(RoiManager.java:1594) at ij.macro.Functions.roiManager(Functions.java:2400) at ij.macro.Functions.getFunctionValue(Functions.java:215) at ij.macro.Interpreter.getFactor(Interpreter.java:1296) at ij.macro.Interpreter.getTerm(Interpreter.java:1267) at ij.macro.Interpreter.getStringExpression(Interpreter.java:1403) at ij.macro.Interpreter.getStringTerm(Interpreter.java:1226) at ij.macro.Interpreter.getString(Interpreter.java:1183) at ij.macro.Interpreter.doStatement(Interpreter.java:259) at ij.macro.Interpreter.doStatements(Interpreter.java:202) at ij.macro.Interpreter.run(Interpreter.java:103) at ij.macro.Interpreter.run(Interpreter.java:73) at CLI.Refresh_Macros.runScript(Refresh_Macros.java:56) at common.RefreshScripts.runScript(RefreshScripts.java:325) at fiji.scripting.TextEditor$Tab$6.execute(TextEditor.java:1216) at fiji.scripting.TextEditor$Executer$1.run(TextEditor.java:1776) Can anyone explain this unexpected behaviour? I run ImageJ version 1.46g, java 1.6.0_31 (32-bit) and updated Fiji. Thanks in advance. Best, W |
Hi Winnok,
On Thu, 12 Apr 2012, Winnok H. De Vos wrote: > Started Macro.ijm at Tue Apr 03 12:05:27 CEST 2012 > java.lang.NullPointerException: null > at ij.plugin.filter.Analyzer.saveResults(Analyzer.java:409) > at ij.plugin.filter.Analyzer.measure(Analyzer.java:241) > at ij.plugin.filter.Analyzer.run(Analyzer.java:88) > [...] This looks suspiciously similar to the stacktrace in http://fiji.sc/cgi-bin/bugzilla/show_bug.cgi?id=420 If the issue is the same, updating to the daily build may work around the underlying problem. Ciao, Dscho |
:-)
Cheers Johannes! W Hi Winnok, On Thu, 12 Apr 2012, Winnok H. De Vos wrote: > Started Macro.ijm at Tue Apr 03 12:05:27 CEST 2012 > java.lang.NullPointerException: null > at ij.plugin.filter.Analyzer.saveResults(Analyzer.java:409) > at ij.plugin.filter.Analyzer.measure(Analyzer.java:241) > at ij.plugin.filter.Analyzer.run(Analyzer.java:88) > [...] This looks suspiciously similar to the stacktrace in http://fiji.sc/cgi-bin/bugzilla/show_bug.cgi?id=420 If the issue is the same, updating to the daily build may work around the underlying problem. Ciao, Dscho |
Free forum by Nabble | Edit this page |