Re: ImageJ Macro List.get("Area") return value as a String

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/is-global-scale-not-working-on-Fiji-Macro-running-on-PC-tp5018267p5018274.html

Hi John,

the List in the ImageJ Macro language can only hold Strings, not numbers
(maybe this is not perfectly clear from the description). You need
parseFloat(a) to recover the number.


Michael
________________________________________________________________
On 10/03/2017 12:07, LIM Soon Yew John wrote:

> Dear All,
>
> When I wrote the ImageJ (2.0.0-rc59/1.51j; java 1.8.0_66 [64-bit])
> macro below, it return my area result as a string. Is this a bug or
> normal behaviour?
>
> List.setMeasurements; a = List.get("Area"); print(a); a = a / a;
> print(a); //will return an error message that say statement cannot
> begin with "/"
>
> Best Regards, John

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html