Re: help with stack of masks
Posted by
Michael Schmid on
May 12, 2009; 6:35pm
URL: http://imagej.273.s1.nabble.com/Swing-Java-components-in-ImageJ-plugin-frames-tp3692563p3692566.html
Hi Leon,
the Particle Analyzer does not accept PlugInFilter options in the
'options' argument. PlugInFilter options are processed by the
PlugInFilterRunner, which would call the particle analyzer's run(ip)
method for all stack slices if the DOES_STACKS flag is set.
So you have to use a loop over stack slices.
Michael
________________________________________________________________
On 12 May 2009, at 11:29, Leon Espinosa wrote:
> Dear all,
>
> I'm trying to obtain the ImagePlus of the stack of masks created by
> the analyze particle command. But I get only de active slide. I
> guess there is something wrong with the flag
> "PlugInFilter.DOES_STACKS"... ??
> this is the code:
>
> public class My_Plugin implements PlugIn {
> ImagePlus imp, impOut;
> ParticleAnalyzer pa;
> ResultsTable rt;
>
> public void run(String arg) {
> imp=IJ.getImage();
> rt = new ResultsTable();
> pa = new ParticleAnalyzer(ParticleAnalyzer.SHOW_MASKS|
> PlugInFilter.DOES_STACKS, Measurements.AREA, rt, 100, 10000);
> pa.analyze(imp);
> impOut = pa.getOutputImage();
> impOut.show();
> IJ.showMessage("My_Plugin","Hello world!");
>
> }
>
> }
>
>
> Thank you...
>
> all the best,
>
> Leon Espinosa