Analyze Particles

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

Analyze Particles

Mohamed Tleis
Dear Members,

I was wondering whether there is a way to apply "analyze particles" on an
ImageProcessor in my java code, instead of ImagePlus; Currently I am using
the IJ.run command to run the analyzer; But I want to run it only on my
ImageProcessor without having to create an ImagePlus for it;

I had a look at the ij.plugin.filter.Analyzer; but it seems not to have
methods to work with ImageProcessors directly;

Any suggestions?

Best Regards,
M. Tleis

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Analyze Particles

Thomas Boudier
Hi,

here a small example that can be helpful :

plus=IJ.getImage()
rt=ResultsTable.getResultsTable();
if(rt==null) rt=new ResultsTable();
manager=RoiManager.getInstance();
if(manager==null) manager=new RoiManager();

analyser=new
ParticleAnalyzer(ParticleAnalyzer.SHOW_RESULTS+ParticleAnalyzer.ADD_TO_MANAGER,
Measurements.AREA, rt, 10, Double.MAX_VALUE, 0,1);

analyser.analyze(plus);
rt.updateResults(); rt.show("Results");

have a look to class Measurements to selct the measurements and class
ParticleAnalyzer for options with analyse paticles.

Thomas


Le 15/06/2012 12:39, Mohammed Tlais a écrit :

> Dear Members,
>
> I was wondering whether there is a way to apply "analyze particles" on an
> ImageProcessor in my java code, instead of ImagePlus; Currently I am using
> the IJ.run command to run the analyzer; But I want to run it only on my
> ImageProcessor without having to create an ImagePlus for it;
>
> I had a look at the ij.plugin.filter.Analyzer; but it seems not to have
> methods to work with ImageProcessors directly;
>
> Any suggestions?
>
> Best Regards,
> M. Tleis
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
   /**********************************************************/
      Thomas Boudier, MCU Université Pierre et Marie Curie,
      Modélisation Cellulaire et Imagerie Biologique (EE1),
      IFR 83, Bat B 7ème étage, porte 723, Campus Jussieu.
      Tel : 01 44 27 46 92   Fax : 01 44 27 22 91
/*******************************************************/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Analyze Particles

Michael Schmid
In reply to this post by Mohamed Tleis
Hi Mohammed,

the Particle Analyzer needs to know the spatial image calibration, so it only works with an ImagePlus, not with a bare an ImageProcessor (an ImageProcessor has no spatial calibration).

If you have only an ImageProcessor, you can create an ImagePlus with default calibration from it:

    ImagePlus imp = new ImagePlus("any title", ip);


Michael
________________________________________________________________
On Jun 15, 2012, at 12:39, Mohammed Tlais wrote:

> Dear Members,
>
> I was wondering whether there is a way to apply "analyze particles" on an
> ImageProcessor in my java code, instead of ImagePlus; Currently I am using
> the IJ.run command to run the analyzer; But I want to run it only on my
> ImageProcessor without having to create an ImagePlus for it;
>
> I had a look at the ij.plugin.filter.Analyzer; but it seems not to have
> methods to work with ImageProcessors directly;
>
> Any suggestions?
>
> Best Regards,
> M. Tleis
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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