mastodon-sc / mastodon

Mastodon – a large-scale tracking and track-editing framework for large, multi-view images.
BSD 2-Clause "Simplified" License
66 stars 20 forks source link

Mastodon may freeze with overlay visibility track of focused vertex #295

Closed stefanhahmann closed 1 month ago

stefanhahmann commented 3 months ago

Steps to reproduce

  1. Create a new Mastodon project using https://github.com/mastodon-sc/mastodon-example-data/blob/master/tgmm-mini/datasethdf5.xml and https://github.com/mastodon-sc/mastodon-example-data/blob/master/tgmm-mini/datasethdf5.h5
  2. Open BDV
  3. Track a few spots using a button in the BDV
  4. Ensure that last tracked spot is focused and highlighted (i.e. pink + solid line, cf. video below) and the mouse pointer is inside this spot.
  5. Stop moving the mouse
  6. Use button v to set Overlay visibility to Track of focused vertex
  7. Press button a
  8. Mastodon is now "Frozen", i.e. Menus cannot be accessed anymore. Even Fiji cannot be closed properly.

GIF 13 03 2024 17-59-21

tinevez commented 3 months ago

I could not reproduce with beta-29 on Mac or on Windows. Could you try with a 'fresh' Fiji? Or on another computer?

stefanhahmann commented 3 months ago

I could not reproduce with beta-29 on Mac or on Windows. Could you try with a 'fresh' Fiji? Or on another computer?

I could reproduce the bug yesterday on three independent machine (2 windows, 1 ubuntu) with beta-29. I could just reproduce it again with a 'fresh' Fiji and beta-29. I added one more step to the steps to reproduce description to make the step description more precise.

tinevez commented 3 months ago

I could reproduce the bug! Thanks for your accurate step description. Apparently not moving the mouse is important to have the bug. This hints an issue with not having a focused vertex when the mode is selected. I tried to check that happened to the 'focus' using a TrackScheme window on the side.

My best guess would be that the crash is actually linked to NOT having a focused vertex, when the display mode 'Track of focused vertex' is selected.

I will check what happens when the visibility mode is changed in this case. A first suspect to interrogate would be: https://github.com/mastodon-sc/mastodon/blob/master/src/main/java/org/mastodon/views/bdv/overlay/Visibilities.java#L329

stefanhahmann commented 3 months ago

My best guess would be that the crash is actually linked to NOT having a focused vertex, when the display mode 'Track of focused vertex' is selected.

Yes, exactly. This is the reason, which causes the freeze / deadlock.

My PR (https://github.com/mastodon-sc/mastodon/issues/295), which suppresses the problem feels more like a workaround than a real solution.

stefanhahmann commented 3 months ago

I will check what happens when the visibility mode is changed in this case. A first suspect to interrogate would be: https://github.com/mastodon-sc/mastodon/blob/master/src/main/java/org/mastodon/views/bdv/overlay/Visibilities.java#L329

I also have the impression that the line you mention in conjunction with https://github.com/mastodon-sc/mastodon/blob/373a2a95901c0d496a18a78b4a5ee37ada822a7b/src/main/java/org/mastodon/views/bdv/overlay/Visibilities.java#L338 causes the problem.

stefanhahmann commented 1 month ago

@tinevez I noticed that you have merged https://github.com/mastodon-sc/mastodon/pull/297 which was targeted to circumvent the bug described in this issue. I would suggest to close this issue, unless you are still up for a better solution to it?

tinevez commented 1 month ago

No this is the right fix for this bug.