Analyze, Particles opens the ROI manager

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

Analyze, Particles opens the ROI manager

Avital Steinberg
Hi,
I'm trying to work in batch mode (in Javascript), so I hid the images,
results table and ROI manager. The problem is that when I use Analyze,
particles, the ROI manager opens:

IJ.run(imp, "Analyze Particles...", "include add");

Is there a way to analyze the particles without displaying the ROI manager?
I'm using the daily build 1.50c9.

I tried to use the Particle Analyzer class. I saw that it was much faster
without displaying the ROI manager. I know that the particles were
segmented because the results table was updated. However, I was unable to
display the ImagePlus. I used the command:

pa.analyze(imp,ip);

How can the results of the segmentation be displayed on the ImagePlus,
similarly to what is done automatically in Analyze, Particles?

Thanks,
Avital

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

Re: Analyze, Particles opens the ROI manager

Rasband, Wayne (NIH/NIMH) [E]
> On Sep 12, 2015, at 4:24 PM, Avital Steinberg <[hidden email]> wrote:
>
> Hi,
> I'm trying to work in batch mode (in Javascript), so I hid the images,
> results table and ROI manager. The problem is that when I use Analyze,
> particles, the ROI manager opens:
>
> IJ.run(imp, "Analyze Particles...", "include add");
>
> Is there a way to analyze the particles without displaying the ROI manager?
> I'm using the daily build 1.50c9.
>
> I tried to use the Particle Analyzer class. I saw that it was much faster
> without displaying the ROI manager. I know that the particles were
> segmented because the results table was updated. However, I was unable to
> display the ImagePlus. I used the command:
>
> pa.analyze(imp,ip);
>
> How can the results of the segmentation be displayed on the ImagePlus,
> similarly to what is done automatically in Analyze, Particles?

Use an Overlay instead of the ROI Manager. Here is an example:

  imp = IJ.openImage("http://imagej.nih.gov/ij/images/blobs.gif");
  IJ.setAutoThreshold(imp, "Default");
  IJ.run(imp, "Analyze Particles...", "  show=[Overlay Outlines]");
  ip = imp.getProcessor();
  overlay = imp.getOverlay();
  for (i=0; i<overlay.size(); i++) {
     ip.setRoi(overlay.get(i));
     stats = ip.getStatistics();
     print(i+": size="+stats.pixelCount+", mean="+IJ.d2s(stats.mean,2));
  }
  imp.show();

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

Re: Analyze, Particles opens the ROI manager

Avital Steinberg
Thanks, Wayne - now it works fast!

Avital

On Sun, Sep 13, 2015 at 1:11 AM, Rasband, Wayne (NIH/NIMH) [E] <
[hidden email]> wrote:

> > On Sep 12, 2015, at 4:24 PM, Avital Steinberg <[hidden email]>
> wrote:
> >
> > Hi,
> > I'm trying to work in batch mode (in Javascript), so I hid the images,
> > results table and ROI manager. The problem is that when I use Analyze,
> > particles, the ROI manager opens:
> >
> > IJ.run(imp, "Analyze Particles...", "include add");
> >
> > Is there a way to analyze the particles without displaying the ROI
> manager?
> > I'm using the daily build 1.50c9.
> >
> > I tried to use the Particle Analyzer class. I saw that it was much faster
> > without displaying the ROI manager. I know that the particles were
> > segmented because the results table was updated. However, I was unable to
> > display the ImagePlus. I used the command:
> >
> > pa.analyze(imp,ip);
> >
> > How can the results of the segmentation be displayed on the ImagePlus,
> > similarly to what is done automatically in Analyze, Particles?
>
> Use an Overlay instead of the ROI Manager. Here is an example:
>
>   imp = IJ.openImage("http://imagej.nih.gov/ij/images/blobs.gif");
>   IJ.setAutoThreshold(imp, "Default");
>   IJ.run(imp, "Analyze Particles...", "  show=[Overlay Outlines]");
>   ip = imp.getProcessor();
>   overlay = imp.getOverlay();
>   for (i=0; i<overlay.size(); i++) {
>      ip.setRoi(overlay.get(i));
>      stats = ip.getStatistics();
>      print(i+": size="+stats.pixelCount+", mean="+IJ.d2s(stats.mean,2));
>   }
>   imp.show();
>
> -wayne
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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