Bug in ROI Manager?

Posted by Krs5 on
URL: http://imagej.273.s1.nabble.com/Bug-in-ROI-Manager-tp5020679.html

Dear list, dear Wayne,

Trying to merge different numbers of ROIs from a Z-stack  after a question from Jacqueline Ross earlier on the list I came across some strange behaviour in the ROI Manager.
Example code ImageJ macro that works:

run("Confocal Series (2.2MB)");
makeRectangle(153, 173, 33, 30);
roiManager("Add");
makeRectangle(192, 226, 40, 37);
roiManager("Add");
makeRectangle(132, 259, 39, 38);
roiManager("Add");
roiManager("Select", newArray(0,1,2));
roiManager("Combine");
roiManager("Add");
roiManager("Delete");
roiManager("Show All");

Now, if I don't know the number of ROIs and collect these separate in a variable I get:

run("Confocal Series (2.2MB)");
makeRectangle(153, 173, 33, 30);
roiManager("Add");
makeRectangle(192, 226, 40, 37);
roiManager("Add");
makeRectangle(132, 259, 39, 38);
roiManager("Add");
c= newArray(0,1,2);
roiManager("Select", newArray(c));
roiManager("Combine");
roiManager("Add");
roiManager("Delete");
roiManager("Show All");

However, this has now deleted all ROIs from the manager, not the once I had expected. Up to adding the combined ROI to the Manager everything is OK but after that the selection in the Manager is different and it does not recognize what is selected and deletes all ROIs. Adding  "roiManager("Select", newArray(c));" before trying to delete ROIs does not work. Adding " roiManager("Select", newArray(0,1,2));" however at this point works as expected. I assume this is a bug?

I run Fiji/ImageJ 2.0.0-rc-65/1.52b Java1.8.0-66 on a Windows 7 system 64bit

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
www.le.ac.uk/advanced-imaging-facility

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