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

Bug in Visualization/ROI when using macro code #5

Closed zitmen closed 9 years ago

zitmen commented 9 years ago
What steps will reproduce the problem?
1. Load a results table, lauch the macro recorder, then manually reconstruct a ROI
with the parameters:
Left top x [px]: 100
Left top y [px]: 100
Width [px]: 10
Height [px]: 1
It will correctly reconstruct an image corresponding to a 10x10 px ROI in the acquired
image

2. The obtained macro code is:
run("Visualization", "imleft=100 imtop=100 imwidth=10 imheight=10 renderer=[Normalized
Gaussian] magnification=8.0 dxforce=false colorizez=false dx=20.0 threed=false");

3. Run this macro code

What is the expected output? What do you see instead?

This should generate the same reconstruction as the manual operation. Instead the following
error happens:

java.lang.IllegalArgumentException: xmax (ymax) must be greater than xmin (ymin)
    at cz.cuni.lf1.lge.ThunderSTORM.rendering.AbstractRendering$AbstractBuilder.roi(AbstractRendering.java:84)
    at cz.cuni.lf1.lge.ThunderSTORM.rendering.ui.DensityRenderingUI.getMethod(DensityRenderingUI.java:96)
    at cz.cuni.lf1.lge.ThunderSTORM.rendering.ui.AbstractRenderingUI.getImplementation(AbstractRenderingUI.java:155)
    at cz.cuni.lf1.lge.ThunderSTORM.rendering.ui.AbstractRenderingUI.getImplementation(AbstractRenderingUI.java:20)
    at cz.cuni.lf1.lge.ThunderSTORM.RenderingPlugIn.run(RenderingPlugIn.java:135)
    at ij.IJ.runUserPlugIn(IJ.java:199)
    at ij.IJ.runPlugIn(IJ.java:163)
    at ij.Executer.runCommand(Executer.java:131)
    at ij.Executer.run(Executer.java:61)
    at ij.IJ.run(IJ.java:269)
    at ij.macro.Functions.doRun(Functions.java:590)
    at ij.macro.Functions.doFunction(Functions.java:89)
    at ij.macro.Interpreter.doStatement(Interpreter.java:226)
    at ij.macro.Interpreter.doStatements(Interpreter.java:214)
    at ij.macro.Interpreter.run(Interpreter.java:111)
    at ij.macro.Interpreter.run(Interpreter.java:81)
    at CLI.Refresh_Macros.runScript(Refresh_Macros.java:56)
    at common.RefreshScripts.runScript(RefreshScripts.java:328)
    at fiji.scripting.TextEditor$Tab$6.execute(TextEditor.java:1225)
    at fiji.scripting.TextEditor$Executer$1.run(TextEditor.java:1785)

What version of the product are you using? On what operating system?
(Fiji Is Just) ImageJ 1.48s; Java 1.6.0_65 [64-bit]; Mac OS X 10.9.2

Please provide any additional information below.
The error : "xmax (ymax) must be greater than xmin (ymin)" suggests a confusion
in ROI parameters. In fact to obtain the same reconstruction from macro code, you have
to input (100,100,110,110) as ROI parameters instead of (100,100,10,10) in manual operation.
That means that the bug is : when running macro code, the two last parameters are interpreted
as the bottom right coordinates of the ROI rather than the Width and Height of the
ROI.

Hope this helps,
Christophe

Original issue reported on code.google.com by lechristophe on 2014-03-21 08:56:55

zitmen commented 9 years ago
I'm sorry there is a typo in step 1 : the parameters should be

Left top x [px]: 100
Left top y [px]: 100
Width [px]: 10
Height [px]: 10

Original issue reported on code.google.com by lechristophe on 2014-03-21 08:57:55

zitmen commented 9 years ago
Thank you for reporting this bug. You are right, the error was caused by incorrect interpretation
of width/right and height/bottom. It should work properly now.

Fixed in revision c02cbab7167b. New daily build is now available.

Original issue reported on code.google.com by zitmen on 2014-03-21 11:38:41

zitmen commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by zitmen on 2014-03-21 11:39:09