Login  Register

Re: macro for OD calibration based on autoupdate of measured grey value

Posted by dscho on Nov 22, 2006; 10:06am
URL: http://imagej.273.s1.nabble.com/macro-for-OD-calibration-based-on-autoupdate-of-measured-grey-value-tp3700961p3700963.html

Hi,

On Wed, 22 Nov 2006, jarek wrote:

> > run("Calibrate...", "function=[Straight Line] unit=OD text1=[160.35 122.63
> > 88.74 58.22 6.99 0.03 ] text2=[3.69 2.87 2.20 1.52 0.40 0]");
>
> i try to apply the getResult command to insert measured values in line of
> text1 of OD calibration.... i use :
>
> for (i=0; i<nResults; i++)
>     getResult("Mean",i));
>
> but don't know how to make macro to read these values.

How about something like this:

text1 = "[";
for (i = 0; i < nResults; i++) {
        if (i > 0)
                text1 += " ";
        text1 += getResult("Mean", i);
}
text1 = "]";

run("Calibrate...", "function=[Straight Line] unit=OD text1=["
        + text1 + " text2=[3.69 2.87 2.20 1.52 0.40 0]");

Hth,
Dscho