Outputting to a table...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Outputting to a table...

Rotella, Anthony M. (GRC)[]
Hello all,

        Is there an easy way to output some information from an ImageJ
macro to a table of some kind? Thanks...

Tony Rotella
Reply | Threaded
Open this post in threaded view
|

Re: Outputting to a table...

Wayne Rasband
> Is there an easy way to output some information from an
> ImageJ macro to a table of some kind? Thanks...

You can use the setResult("Column", row, value) macro function to
display values in the Results table.

    http://rsb.info.nih.gov/ij/developer/macro/functions.html#setResult

Here are two examples on the ImageJ website:

     http://rsb.info.nih.gov/ij/macros/SineCosineTable.txt
     http://rsb.info.nih.gov/ij/macros/ConvexitySolidarity.txt

You can also use the print() function to output values to a table.

     http://rsb.info.nih.gov/ij/developer/macro/functions.html#print

Here is an example:

     requires("1.38m");
     title1 = "Sine/Cosine Table";
     title2 = "["+title1+"]";
     f = title2;
     if (isOpen(title1))
        print(f, "\\Clear");
     else
        run("New... ", "name="+title2+" type=Table width=250
height=600");
     print(f, "\\Headings:n\tSine\tCosine");
     for (n=0; n<=2*PI; n += 0.1)
        print(f, n + "\t" + sin(n) + "\t" + cos(n));

-wayne