convex hull

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

convex hull

Eric Janiaud
Hi

I'd like to use the function convex and hull that appears in the menu  
Edit/Selection/Convex Hull in my plugin.
unfortunately, I could not find the api of the function because the  
documentation is too old.

Thanks in advance



--
Dr. Eric Janiaud
School of Physics
Trinity College Dublin
College Green
Dublin 2
Ireland

NEW : Phone: 00353 - 1 - 608 8453
Fax:   00353 - 1 - 671 1759
Reply | Threaded
Open this post in threaded view
|

Re: convex hull

Wayne Rasband
> I'd like to use the function convex and hull that appears in
> the menu Edit/Selection/Convex Hull in my plugin.
> unfortunately, I could not find the api of the function
> because the documentation is too old.

The command recorder (Plugins>Macros>Record) is your friend. It
generates this macro function

    run("Convex Hull");

which can be converted to Java code by adding "IJ."

     IJ.run("Convex Hull");

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: convex hull

Gary Chinga
you can use the following method in a plugin:

//////////////////////////
        float[][] findConvexArea(ResultsTable rt, ImageProcessor ipTemp){
                int nParticles = rt.getCounter();
                ResultsTable systemRT= ResultsTable.getResultsTable();
                float[][] cValues = new float[2][nParticles]; //Array for the area
and perimeter convex dimension for each particle
                ImagePlus impTemp = new ImagePlus("Test", ipTemp);
                WindowManager.setTempCurrentImage(impTemp);

                for (int i=0; i<nParticles;i++){
                    IJ.doWand((int)rt.getValue("XStart", i),(int)rt.getValue
("YStart", i));
                        IJ.run("Convex Hull");
                        IJ.run("Measure");
                        cValues[0][i] = (float)systemRT.getValue("Area", i);
                        cValues[1][i] = (float)systemRT.getValue("Perim.", i);
                }
                systemRT.reset();
                return cValues;
        }
/////////////////////////////

But I wonder if it is possible to include the the convex hull in the  
particle analyzer. Or how to extend the particle analyzer to also  
include the convex hull so we avoid the IJ.doWand and IJ. commands.  
These commands slow down the plugin performance.

Gary.


On Mar 7, 2006, at 5:59 PM, Wayne Rasband wrote:

>> I'd like to use the function convex and hull that appears in
>> the menu Edit/Selection/Convex Hull in my plugin.
>> unfortunately, I could not find the api of the function
>> because the documentation is too old.
>
> The command recorder (Plugins>Macros>Record) is your friend. It  
> generates this macro function
>
>    run("Convex Hull");
>
> which can be converted to Java code by adding "IJ."
>
>     IJ.run("Convex Hull");
>
> -wayne
>
>
Reply | Threaded
Open this post in threaded view
|

Re: convex hull

Gabriel Landini
In reply to this post by Eric Janiaud
> But I wonder if it is possible to include the the convex hull in the  
> particle analyzer. Or how to extend the particle analyzer to also  
> include the convex hull so we avoid the IJ.doWand and IJ. commands.  
> These commands slow down the plugin performance.

If you need it in a hurry, the Particles8_Plus returns the the convex hull and
convex area of particles (among other morpholometrical descriptors).

Cheers,

G.