Re: how to use the ParticleAnalyzer class

Posted by Aryeh Weiss on
URL: http://imagej.273.s1.nabble.com/how-to-use-the-ParticleAnalyzer-class-tp5022373p5022378.html

Thank you to Michael Schmid and Jerome Mutterer for your  quick
responses that solved my problem and greatly enlightened me. Michael's
response was sent to the list, and I also include below  Jerome's
response that provides a link to a number of examples on how to use the
ParticleAnalyzer class.

Best regards
--aryeh


 From Jerome Mutterer:
> Hi Aryeh
> Here are some examples:
> https://www.programcreek.com/java-api-examples/index.php?api=ij.plugin.filter.ParticleAnalyzer
>
> Sincerely,
> Jerome
>
And from Michael Schmid

On 20/08/2019 17:54, Michael Schmid wrote:

> Hi Aryeh,
>
> here is a basic JavaScript example for the ParticleAnalyzer:
>
> rt = new ResultsTable();
> imp = IJ.getImage();
> pa = new ParticleAnalyzer(
>   /*options=*/ 0,
>   /*measurements=*/ Measurements.AREA+Measurements.MEAN,
>   rt,
>   /*minSize=*/ 0.0,
>   /*maxSize=*/ 1.0e6,
>   /*minCirc=*/ 0.0,
>   /*maxCirc=*/ 1.0);
> pa.analyze(imp);
> rt.show("myResults");
>
> For the measurement options, see
>
> https://github.com/imagej/imagej1/blob/master/ij/measure/Measurements.java 
>
>
> Michael
> ________________________________________________________________
> On 20.08.19 15:02, Aryeh Weiss wrote:
> > Until now, I ave been using the ParticleAnalyer by running it from
> the IJ.run method, and I want to start using it through its API.
> >
> > I am embarrassed to say that I cannot figure out how to set it up -
> in particular the options and measurements parameters. I looked for
> either Java or Python examples, which I thought I saw in the past, and
> I cannot find them.
> >
> > Can someone who knows how to do this send to me some code snippets
> in which options and measurements are set and then the PA is run?
> >
> > I d not know why i am having so much trouble with this, but I cannot
> seem to get my head around how to use the parameters in ij.measure,
> what goes into options and what goes into measurements in a
> constructor like
> >
> > |ParticleAnalyzer
> <https://imagej.nih.gov/ij/developer/api/ij/plugin/filter/ParticleAnalyzer.html#ParticleAnalyzer-int-int-ij.measure.ResultsTable-double-double->(int
> options, int measurements, ResultsTable
> <https://imagej.nih.gov/ij/developer/api/ij/measure/ResultsTable.html>
> rt, double minSize, double maxSize)|
> >
> > |Thanks in advance|
> >
> > |--aryeh
> > |
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html