is there a way to set the location of the results table and the ROI manager via a macro.
setlocation function seems useless in this case.
you need to select the respective Windows first. Then
setLocation(x, y);works. You can test the following macro when the table and the roi manager are open.
selectWindow("Results"); setLocation(0,0); selectWindow("ROI Manager"); setLocation(50, 50);
Thanks but what bout the size of the windows as well?
“setLocation(x, y, width, height)” does not work…
via a macro this is not possible (at least not that I would know of it).
See the specification of the macro commands. It only applies to image windows.
setLocation(x, y, width, height)
Moves and resizes the active image window. The new location of the top-left corner is specified by x and y, and the new size by width and height.
With a script this will be possible.
I am actually not familiar with groovy scripts so far but trying the following worked as a groovy script from the Fiji script editor.
import ij.plugin.frame.RoiManager; import ij.measure.ResultsTable; rm = RoiManager.getInstance(); rm.setSize(250,300); rm.setLocation(0, 0); rt = ResultsTable.getResultsWindow(); rt.setSize(800,500); rt.setLocation(251, 0);
Alternatively you can add the upper groovy script with the following line directly into your macro.
eval("bsh", "rm = RoiManager.getInstance();rm.setSize(250,300);rm.setLocation(0, 0);rt = ResultsTable.getResultsWindow();rt.setSize(800,500);rt.setLocation(251, 0);");
I just figured out that interpreting it as a BeanShell script via the
eval("bsh", script); macro command works (at least for this type of commands).
How to save my counter results on my image?
That’s because your script uses semicolons (
;) to end every line. This is not required (but allowed) in Groovy, but is required in Beanshell, so it turns out your script has valid syntax for both Groovy and Beanshell
Serendipity of the ignoramus is a b… (the good old penicillin-effect )
Thanks for pointing that out
…need to learn more on Groovy