Login  Register

Re: Pls: on a "customizable" Set Measurements

Posted by Wayne Rasband on Feb 05, 2008; 4:11pm
URL: http://imagej.273.s1.nabble.com/Pls-on-a-customizable-Set-Measurements-tp3697273p3697274.html

Here is a macro that runs the Measure command, calculates F=
(Imax-Imin)/(Imax+Imin) and adds the result of this calculation to the
Results table. You run the macro by pressing the F1 key.

    macro "Derive Result [f1]" {
       run("Measure");
       min = getResult('Min', nResults-1);
       max = getResult('Max', nResults-1);
       if (isNaN(min) || isNaN(max))
          exit("Min & Max not enabled in 'Set Measurements'");
       F = (max-min)/(max+min);
       setResult("F", nResults-1, F);
       updateResults();
    }

-wayne

On Feb 5, 2008, at 6:02 AM, Juan Francisco wrote:

> Hi all:
>   On Analyze-->Set Measurement , there  are some operations avalaible.
> But it would be possible to enter some matematical expresion as well?
> For instance if I´m intersted into compyte the quantity F=
> (Imax-Imin)/(Imax+Imin) (where I is gray value) on a ROI, is there
> some way to adds this equation to Set Measurement
>   Thanks very much
>   JFC
>
>
> ---------------------------------
>
> ¿Con Mascota por primera vez? - Sé un mejor Amigo
> Entra en Yahoo! Respuestas.
>
>