You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you add a MouseWheelListener to the Image5D UI elements, then call ImagePlus.getChannel(), ImagePlus.getSlice() and ImagePlus.getFrame(), you will get the most up-to-date values. However, if you add an AdjustmentListener to applicable UI elements (i.e., ScrollBars), position values queried with the above methods will be off. The reason is that Image5D employs a special polling thread that synchronizes the Image5D/ImagePlus position with that of the Image5DWindow/StackWindow. The AdjustmentListeners are notified of changes to the StackWindow immediately, before the polling thread has noticed the discrepancy and synchronized the Image5D's position to match the new one in the window.
For an example of this bug in action, see Main.java.
I started work on a fix on the position-sync branch, but the issue is extremely thorny and I do not have time to completely follow through. Patches welcome.
Ultimately, the best fix would be to eliminate the replicated data structures; keeping multiple data structures in sync is a suboptimal approach. Rather, we should simply store the current position in a single place (probably Image5D), which is immediately updated upon a UI change.
The text was updated successfully, but these errors were encountered:
If you add a MouseWheelListener to the Image5D UI elements, then call ImagePlus.getChannel(), ImagePlus.getSlice() and ImagePlus.getFrame(), you will get the most up-to-date values. However, if you add an AdjustmentListener to applicable UI elements (i.e., ScrollBars), position values queried with the above methods will be off. The reason is that Image5D employs a special polling thread that synchronizes the Image5D/ImagePlus position with that of the Image5DWindow/StackWindow. The AdjustmentListeners are notified of changes to the StackWindow immediately, before the polling thread has noticed the discrepancy and synchronized the Image5D's position to match the new one in the window.
For an example of this bug in action, see Main.java.
I started work on a fix on the position-sync branch, but the issue is extremely thorny and I do not have time to completely follow through. Patches welcome.
Ultimately, the best fix would be to eliminate the replicated data structures; keeping multiple data structures in sync is a suboptimal approach. Rather, we should simply store the current position in a single place (probably Image5D), which is immediately updated upon a UI change.
The text was updated successfully, but these errors were encountered: