Login  Register

A problem with hiding the Roi manager

Posted by Avital Steinberg on Jul 14, 2016; 6:03am
URL: http://imagej.273.s1.nabble.com/A-problem-with-hiding-the-Roi-manager-tp5016880.html

Hi,
I'm using Javascript and running the following code on the attached image,
and it works well.
The number of rois in the manager is one, like I expect:

mportClass(Packages.ij.IJ);
importClass(Packages.ij.plugin.frame.RoiManager);
importClass(Packages.ij.ImagePlus);
importClass(Packages.ij.process.ImageProcessor);
importClass(Packages.ij.gui.Overlay);
importClass(Packages.ij.plugin.filter.ParticleAnalyzer);
importClass(Packages.ij.gui.Roi);
importClass(Packages.ij.plugin.filter.Analyzer);
importPackage(java.awt);

imp = IJ.getImage();
ip = imp.getProcessor();
ovr = imp.getOverlay();
rm = RoiManager();// The Roi manager is displayed
segRoi = ovr.get(0);
imp.setRoi(segRoi);
IJ.setThreshold(imp, 362,695);
IJ.run(imp, "Analyze Particles...", "size=50-Infinity add");
n = rm.getCount();
IJ.log("The number of rois in the manager is: " + n);

But when I try to hide the Roi manager, I get a strange result - the number
of Rois in the Roi
manager is zero:

importClass(Packages.ij.IJ);
importClass(Packages.ij.plugin.frame.RoiManager);
importClass(Packages.ij.ImagePlus);
importClass(Packages.ij.process.ImageProcessor);
importClass(Packages.ij.gui.Overlay);
importClass(Packages.ij.plugin.filter.ParticleAnalyzer);
importClass(Packages.ij.gui.Roi);
importClass(Packages.ij.plugin.filter.Analyzer);
importPackage(java.awt);


imp = IJ.getImage();
ip = imp.getProcessor();
ovr = imp.getOverlay();
rm = RoiManager(true);// The Roi manager is not displayed
segRoi = ovr.get(0);
imp.setRoi(segRoi);
IJ.setThreshold(imp, 362,695);
IJ.run(imp, "Analyze Particles...", "size=50-Infinity add");
n = rm.getCount();
IJ.log("The number of rois in the manager is: " + n);

Is this a bug? How can I used the Roi manager in hidden mode?

Thanks,
Avital






I'm using ImageJ 1.51a13, java 1.6.0_65 on a mac OSX 10.9.5.

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

Thresh105to362cropped.tif (694K) Download Attachment