Login  Register

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

Posted by Jerome Mutterer-3 on Mar 10, 2017; 3:45pm
URL: http://imagej.273.s1.nabble.com/is-global-scale-not-working-on-Fiji-Macro-running-on-PC-tp5018267p5018278.html

You might also use a=List.getValue("Area"); instead.

Jerome.


2017-03-10 12:50 GMT+01:00 Michael Schmid <[hidden email]>:

> 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
>



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
www.ibmp.cnrs.fr

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