Login  Register

Re: Bug in ROI Manager?

Posted by Wayne Rasband-2 on May 17, 2018; 1:24am
URL: http://imagej.273.s1.nabble.com/Bug-in-ROI-Manager-tp5020679p5020681.html

> On May 16, 2018, at 1:38 PM, Straatman, Kees (Dr.) <[hidden email]> wrote:
>
> 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.

This strange behavior is due to a bug in the macro interpreter. There is a syntax error in line 9 of the non-working macro that the interpreter does not detect. The latest ImageJ daily build (1.52c12) fixes this bug and displays this error message when you run the second macro:

   ‘[‘ expected in line 9

    roiManager ( “Select" , newArray (c <)> ) ;

-wayne


> 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

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