Login  Register

Re: Bugs in the Window menu

Posted by Stein Rørvik on Oct 22, 2020; 8:39pm
URL: http://imagej.273.s1.nabble.com/Bugs-in-the-Window-menu-tp5024099p5024103.html

The imageIDs are in the correct order of more negative numbers. I don't think this is connected to imageIDs, as selecting the second entry of the menu selects the secondly opened file. It is the shown names in the menu that are incorrect.

I found out after posting this that the problem is connected to the line rename("t1-head");
If we write rename("t0-head"); instead, the menu ordering is correct. If we rename one of the later windows in the macro to "t1-head" instead, that window name is put at the bottom of the menu and the order is wrong again.

"t1-head" is the default window name of that file. Perhaps ImageJ gets confused when we rename from and to the same name?

Stein

-----Original Message-----
From: ImageJ Interest Group <[hidden email]> On Behalf Of Michael Schmid
Sent: 22. oktober 2020 22:09
To: [hidden email]
Subject: Re: Bugs in the Window menu

Hi Stein,

concerning the first issue, the unexpected ordering of the images in the Window menu, it might be a race condition. On my Linux machine, the Window menu has t1-head at the top and t4-head at the bottom.
I tried with many images (387) as well as with few images (3) in the input directory.

Could you please have a look at the imageIDs? Images added later should have a more negative ImageID (you can see it with Image>Show Info, there is a line starting with "ID".
Usually, each new image gets the most negative ID so far minus 1.
In the current case, opening an image sequence creates a temporary image for each file opened (as many as there are images in the directory), so the spacing between the IDs will be more than one.


I did not try to reproduce the 2nd bug, installing a Plugin in the Windows menu.
I noticed, however, that "Help>Refresh Menus" erases the list of images in the Window menu (and after "Help>Refresh Menus" and opening new images, images that are closed sometimes don't disappear from the Window menu). So it would make sense to add some method that rebuilds the list of Windows (probably sorted by the ImageIDs), and call this method not only with "Help>Refresh Menus" but also if a plugin is installed.


Michael
________________________________________________________________
On 22.10.20 20:39, Stein Rørvik wrote:

> There has for a long time been a bug in the Window menu that sometimes causes the wrong image to be selected when selecting an image name from the dropdown, but I have not been able to reproduce it earlier as it depends on the order of window opening and closing. But today I found a simple way to reproduce the issue:
>
> dir = "C:/Users/steinr/Temp/t1-head/"; run("Close All"); run("Image
> Sequence...", "open=&dir sort"); rename("t1-head"); run("Image
> Sequence...", "open=&dir sort"); rename("t2-head"); run("Image
> Sequence...", "open=&dir sort"); rename("t3-head"); run("Image
> Sequence...", "open=&dir sort"); rename("t4-head");
>
> Selecting the first image on the list selects the first window, but the window title entries in the Window menu is in the wrong order; "t1-head" is at the bottom of the list.
>
> This bug has been there for a couple of years; I reverted to earlier versions and found that this was working in 1.52e and fails in 1.52f.
>
> Another bug is that if a plugin should happen to install an entry to the Window menu, the plugin entry appears as expected before the list of open images, but the image titles in the menu do not match the corresponding image window. Probably the building of the window menu list forgets to take into account the possibility of extra menu entries already there. This bug does not occur in Fiji.
>
> Stein
>
> --
> ImageJ mailing list:
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimage
> j.nih.gov%2Fij%2Flist.html&amp;data=04%7C01%7Cstein.rorvik%40sintef.no
> %7C1c5348cdba4d4568ad8908d876c74bf7%7Ce1f00f39604145b0b309e0210d8b32af
> %7C1%7C0%7C637389945644480449%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nO
> m7Y716uVEIWy0olzckaWhPZL1lqijTOMHSZGAPzdE%3D&amp;reserved=0
>

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=04%7C01%7Cstein.rorvik%40sintef.no%7C1c5348cdba4d4568ad8908d876c74bf7%7Ce1f00f39604145b0b309e0210d8b32af%7C1%7C0%7C637389945644480449%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nOm7Y716uVEIWy0olzckaWhPZL1lqijTOMHSZGAPzdE%3D&amp;reserved=0

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