Re: question why getResult("Label",i) returns NaN instead of string
Posted by
Wayne Rasband-2 on
URL: http://imagej.273.s1.nabble.com/question-why-getResult-Label-i-returns-NaN-instead-of-string-tp5023300p5023301.html
> On May 10, 2020, at 10:49 PM, Cammer, Michael <
[hidden email]> wrote:
>
> Would somebody please help regarding whether this is a bug or I am coding this macro incorrectly?
>
> When I try to use getResult("Label", i), the result is NaN.
You have to use getResultString("Label",i) to get strings from the Label column.
-wayne
> For instance,
>
> labels = newArray(nResults);
> for (i=0; i<nResults; i++) {
> labels[i] = getResult("Label", i);
> redmeans[i] = getResult("Mean", i);
> } // end get red intensitites
>
> correctly puts the red intensities in an array but the labels array is all NaN. I also tried a = getResult("Label", i) and a is assigned NaN.
>
> Example Results table data:
>
> Label Area Mean
> 1 C2-_test_90_IFN_01-1:0001-0007 0.83 15.69
> 2 C2-_test_90_IFN_01-1:0002-0011 2.19 11.90
> 3 C2-_test_90_IFN_01-1:0003-0010 0.71 13.19
> 4 C2-_test_90_IFN_01-1:0004-0020 1.28 11.65
>
> I can get the ROI names from the ROI Manager instead, but curious why this does not work.
>
>
> Thank you!
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html