RoiManager check box "Show all"

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

RoiManager check box "Show all"

Yuekan Jiao-2
Hi

I have some ImageJ plugin code that uses ParticleAnalyzer and
RoiManager. What it does is to apply the ParticleAnalyzer on a binary
image impMask that is not shown, and the outlined Rois are transferred
to the RoiManager for consequent analysis. The problem came to me is
the “Show all” check box, it is unchecked in the previous versions (I
have used 1.45s, 1.46m), but it is checked in the recent versions (I
tested 1.46r and 1.47a) that causes an error “"There are no images
open.” The piece of code is following:

        ResultsTable rt = new ResultsTable();
        ParticleAnalyzer pa = new
ParticleAnalyzer(ParticleAnalyzer.CLEAR_WORKSHEET
                | ParticleAnalyzer.RECORD_STARTS
                | ParticleAnalyzer.ADD_TO_MANAGER
                | ParticleAnalyzer.SHOW_MASKS
                | ParticleAnalyzer.SHOW_RESULTS,
                Measurements.AREA | Measurements.RECT,
                rt, 1, Long.MAX_VALUE, 0, 1);

        pa.setHideOutputImage(true);
        pa.analyze(impMask);
        roiManager = RoiManager.getInstance();
        impPaMask = pa.getOutputImage();
        ipPaMask = impPaMask.getProcessor();

How can I set the check box “Show all” unchecked by default when the
RoiManager pops out? Or there is an image open and the check box is
checked, how can I uncheck it in the code?

Thanks

Yuekan

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

Re: RoiManager check box "Show all"

Rasband, Wayne (NIH/NIMH) [E]
On Jul 26, 2012, at 3:13 PM, Yuekan Jiao wrote:

> Hi
>
> I have some ImageJ plugin code that uses ParticleAnalyzer and
> RoiManager. What it does is to apply the ParticleAnalyzer on a binary
> image impMask that is not shown, and the outlined Rois are transferred
> to the RoiManager for consequent analysis. The problem came to me is
> the “Show all” check box, it is unchecked in the previous versions (I
> have used 1.45s, 1.46m), but it is checked in the recent versions (I
> tested 1.46r and 1.47a) that causes an error “"There are no images
> open.” The piece of code is following:
>
>        ResultsTable rt = new ResultsTable();
>        ParticleAnalyzer pa = new
> ParticleAnalyzer(ParticleAnalyzer.CLEAR_WORKSHEET
>                | ParticleAnalyzer.RECORD_STARTS
>                | ParticleAnalyzer.ADD_TO_MANAGER
>                | ParticleAnalyzer.SHOW_MASKS
>                | ParticleAnalyzer.SHOW_RESULTS,
>                Measurements.AREA | Measurements.RECT,
>                rt, 1, Long.MAX_VALUE, 0, 1);
>
>        pa.setHideOutputImage(true);
>        pa.analyze(impMask);
>        roiManager = RoiManager.getInstance();
>        impPaMask = pa.getOutputImage();
>        ipPaMask = impPaMask.getProcessor();
>
> How can I set the check box “Show all” unchecked by default when the
> RoiManager pops out?

Upgrade to the ImageJ 1.47b daily build. It does not display the "There are no images open" error message when "Show all" is checked in the ROI Manager and no images are open.

> Or there is an image open and the check box is
> checked, how can I uncheck it in the code?

You can use

   rm = RoiManager.getInstance();
   if (rm!=null)
      rm.runCommand("show none");

to uncheck "Show all".

-wayne


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

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