Unexpected ROI Manager dependence of select / translate on "Show All" state

I see a weird dependence of the behavior of the ROI Manager
on whether the “Show All” setting is toggled on or off.

I don’t really understand what is going on, but it appears
that roiManager ("select", i) and/or
roiManager ("translate", x, y) is affected by the setting.

This is related to some funny behavior I saw with some of
the macros in this thread:

Here is a macro that does what should be the same ROI
manipulations, but toggling "show all" / "show none":

for (i = 1; i <= 2; i++) {
    newImage ("roi_issue_" + i, "8-bit ramp", 256, 256, 1);

    if (i == 1) {
        roiManager("show all");
    else {
        roiManager("show none");

    makeLine (20, i * 50, 20, i * 50 + 30);
    roiManager ("add");
    roiManager ("select", 0);
    roiManager ("translate", 30, 0);
    roiManager ("add");

    roiManager ("deselect");
    roiManager ("draw");
    roiManager ("save", "roi_issue_" + i + ".zip");
    roiManager ("delete");

Here are the two resulting images:



And here are the two resulting ROI files:

roi_issue_1.zip (352 Bytes)

roi_issue_2.zip (371 Bytes)

(I ran this test on a recently auto-updated version of Fiji:
ImageJ 2.0.0-rc-69/1.52n; Java 1.8.0_66 [64-bit], on 64-bit
ubuntu 16.04 LTS.)

I don’t know whether this should be considered a bug or
somehow a feature, and I still don’t have a clear picture
of what is going on. But I certainly found this behavior
quite confusing.

Thanks, mm

1 Like