Analyze Particles...without opening a new image-window

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

Analyze Particles...without opening a new image-window

Md Tamjidul Hoque
Dear All

          is there a way to apply "Analyze Particles..." without opening a
new image-window?

I am developing some batch processing where I do not need to have a
image-window opened.

Also, "Analyze Particles..." seemed not to modify the ImagePlus instance it
is applied on rather

it make a separate copy of the modified output. Is there way to avoid these,
that is (1) (higher priority:) Not to open a window

(2) and if possible the change is made on the same ImagePlus instance
instead of on its copy?


I had to use the following code, specially the 2nd line which I wanted to
avoid:
------------------------------------------------------------------------------------------------
IJ.run(imp1,"Analyze Particles...", mystr);   // imp1 is an instance of
ImagePlus
ImagePlus imp2 = WindowManager.getCurrentImage();


Thanks
Tamjid
Reply | Threaded
Open this post in threaded view
|

Re: Analyze Particles...without opening a new image-window

Rasband, Wayne (NIH/NIMH) [E]
On May 22, 2010, at 4:59 AM, Tamjid wrote:

> Dear All
>
>          is there a way to apply "Analyze Particles..." without opening a
> new image-window?
>
> I am developing some batch processing where I do not need to have a
> image-window opened.
>
> Also, "Analyze Particles..." seemed not to modify the ImagePlus
> instance it is applied on rather
>
> it make a separate copy of the modified output. Is there way to avoid
> these, that is (1) (higher priority:) Not to open a window
>
> (2) and if possible the change is made on the same ImagePlus instance
> instead of on its copy?

You can do this by using the "In situ Show" particle analyzer option, which was added in the 1.44b6 daily build. Here is a JavaScript example:

  url = "http://rsb.info.nih.gov/ij/images/blobs.gif";
  imp = IJ.openImage(url);
  IJ.setAutoThreshold(imp, "Default");
  IJ.run(imp, "Analyze Particles...", "size=300 show=Masks in_situ");
  imp.show();

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

Re: Analyze Particles...without opening a new image-window

Md Tamjidul Hoque
Many thanks Wayne, for the update ...

- Tamjid


On Sun, May 23, 2010 at 9:53 AM, Rasband, Wayne (NIH/NIMH) [E] <
[hidden email]> wrote:

> On May 22, 2010, at 4:59 AM, Tamjid wrote:
>
> > Dear All
> >
> >          is there a way to apply "Analyze Particles..." without opening a
> > new image-window?
> >
> > I am developing some batch processing where I do not need to have a
> > image-window opened.
> >
> > Also, "Analyze Particles..." seemed not to modify the ImagePlus
> > instance it is applied on rather
> >
> > it make a separate copy of the modified output. Is there way to avoid
> > these, that is (1) (higher priority:) Not to open a window
> >
> > (2) and if possible the change is made on the same ImagePlus instance
> > instead of on its copy?
>
> You can do this by using the "In situ Show" particle analyzer option, which
> was added in the 1.44b6 daily build. Here is a JavaScript example:
>
>  url = "http://rsb.info.nih.gov/ij/images/blobs.gif";
>  imp = IJ.openImage(url);
>  IJ.setAutoThreshold(imp, "Default");
>  IJ.run(imp, "Analyze Particles...", "size=300 show=Masks in_situ");
>  imp.show();
>
> -wayne
>