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
Draw on the ImageJ window with the paintbrush tool.
Return to napari and toggle the image layer to invisible then back to visible using the eyeball.
Witness the lack of updates.
We know why this happens: it's due to how ImgLib2 images are synced with ImagePlus objects by the imglib2-ij library. It's hard to deal with because the ImagePlus active plane works only by on-heap primitive arrays. The imglib2-ij library works around this by syncing back to the ImgLib2 image whenever the active image plane is changed on the ImagePlus. This is nice, but when you have a 2D image like the example here, it falls down because there is no way to change the active plane. Furthermore, even with >2D images, users will be confused because they will not see the changes happen when jumping back and forth—there is no way for them to know that moving the slider will refresh things. Heck, I didn't remember this during my recent demo, so what are the chances of most users figuring this out? We'll get bug reports.
So, how can we mitigate this issue? I don't have an iron clad answer, but here are some ideas:
Add a refresh button to the napari-imagej toolbar. I think this would be nice and people might stumble on it intuitively, but it is kind of off to the side of the image layer, so it's a bit weird.
Add a listener to ImageWindows that perform a sync whenever the ImageWindow loses focus. This is kind of evil maybe, but it would be effective. And could consider adding this to imglib2-ij rather than only to napari-imagej.
Even more aggressive, we could add some syncing thread that marks the ImagePlus as dirty every time updateAndDraw() is called on it, but only keeps syncing while the image is currently dirty, to avoid accumulating a flood of resyncs. This is the most disruptive option though, as it might result in needless resyncing in some circumstances and impact performance.
Other ideas?
The text was updated successfully, but these errors were encountered:
We know why this happens: it's due to how ImgLib2 images are synced with ImagePlus objects by the imglib2-ij library. It's hard to deal with because the ImagePlus active plane works only by on-heap primitive arrays. The imglib2-ij library works around this by syncing back to the ImgLib2 image whenever the active image plane is changed on the ImagePlus. This is nice, but when you have a 2D image like the example here, it falls down because there is no way to change the active plane. Furthermore, even with >2D images, users will be confused because they will not see the changes happen when jumping back and forth—there is no way for them to know that moving the slider will refresh things. Heck, I didn't remember this during my recent demo, so what are the chances of most users figuring this out? We'll get bug reports.
So, how can we mitigate this issue? I don't have an iron clad answer, but here are some ideas:
ImageWindow
s that perform a sync whenever the ImageWindow loses focus. This is kind of evil maybe, but it would be effective. And could consider adding this to imglib2-ij rather than only to napari-imagej.ImagePlus
as dirty every timeupdateAndDraw()
is called on it, but only keeps syncing while the image is currently dirty, to avoid accumulating a flood of resyncs. This is the most disruptive option though, as it might result in needless resyncing in some circumstances and impact performance.The text was updated successfully, but these errors were encountered: