-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy load shapes #351
Lazy load shapes #351
Conversation
Don't need to use BindingEngine in the view component
From last week discussion, I understood that if a shape in a roi is selected, then a movie either across z or t is played the shape(s) in that roi will be displayed if there is any on the plane. This is not the case. |
See description "This addresses just the first 2 bullet-points from #335 (comment)"
This doesn't include the next 2 points:
Actually, it also does support the last point (no change needed)
|
@will-moore apologies. I got ahead of the game. |
That commit should cover the next bullet points (but not tested yet with "shapes not linked to a given plane":
The user experience is definitely better than it was, but there remains an issue with the frame rate of image pixel data loading is different from the rate that ROIs are updating. |
Previously selecting a ROI, will select all the shapes in that ROI. This means that when I start playing a movie. I have the "selected" bold border around the shape. Now when I select a ROI, the last shape only is selected, so when I play a movie the selection is gone Edit: it depends where I click on the roi entry. If I click between the checkbox and the count, all shapes are selected. |
I can imagine a user being annoyed by the chosen approach so we might have to rethink this use cases. |
OK, there's a couple of issues here:
It seems with both these issues, we are in trouble because we wipe out existing ROI layer for the new plane, and re-create from scratch, instead of updating the current one. So maybe I'll try keeping the ROI layer and all ROIs that were previously loaded and simply add the new ones in when they're loaded. Also I'll try to fix the ROI selection to NOT navigate to the plane of the last Shape. If the current plane has one of the Selected shapes on, don't change Z/T - otherwise navigate to the plane of the FIRST shape? |
That last commit should fix the 'Show' checkbox. Now, this should work for image with paginated ROIs (> 500)
I also added a few notes to the docs/README and a diagram to try and retain some of the knowledge about how this all works, since it's not possible to keep it all in my head and takes a while to work out from the code. |
I used https://merge-ci.openmicroscopy.org/web/webclient/img_detail/105665/
|
I used https://merge-ci.openmicroscopy.org/web/webclient/img_detail/139315/
|
I used https://merge-ci.openmicroscopy.org/web/webclient/img_detail/139315/
|
Can confirm @jburel 's observation. If you do not select any ROI and then play the movie, then only the ROIs which are on a given frame will be loaded once you stop the movie. Edit: Maybe the logic is, that any shape, which is on a plane on which some selected shape is (you selected a ROI with shapes before you started the movie), is loaded, irrespective of whether or not the viewer is on that plane ? There is some logic to this, but it is not helpful or expected. |
There's a couple of issues here. There isn't yet a place in the JS model that stores the 'checked' state of an ROI checkbox. So when loading shapes for the ROI, there's no way to know whether they should be shown. So I'll have to store the ROI checkbox state. |
Having spent a fair bit more time on this, it's proving very hard to manage the selection state of Shapes while changing Z/T and loading new ROIs/Shapes. Probably there are fewer issues to deal with when we don't clear all the existing Shapes. |
It is not great in the sense that it is an |
The video doesn't start to slow because of keeping Shapes in hand.
So, if I can fix the other issue reported above, hopefully this will improve the experience. I think actually there's only one:
|
ef3f2f2
to
39f2c0f
Compare
OK, so that commit ee00f4e should fix "When you uncheck 'Show' on an ROI, then expand the ROI, all the newly loaded shapes should not be visible." |
@will-moore studying https://merge-ci.openmicroscopy.org/web/webclient/img_detail/144215/?dataset=25919 (thanks @jburel for the ROIs), I can see
But as indicated, already now it is a massive improvement imho |
Both points above work as described. The unchecking of the ROI indeed removes the Shapes from display even as you are reloading the ROIs and shapes anew after a new plane was navigated. The planes which are re-visited do not get the "loading ROIs" message and wait. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts from a first go through, also:
- Looking at calls to
get_rois_by_plane
which take ~4s, am I right that this could best be next optimized by having aget_rois_by_tile
? - After running a movie (I think with no ROI selected) under inspection in Chrome, then turning off the movie, then opening/closing/selecting ROIs and shapes, I had some odd behavior, almost like callbacks triggering after the fact.
plugin/omero_iviewer/views.py
Outdated
# Modify query to only select count() and NOT paginate | ||
query = get_query_for_rois_by_plane(the_z, the_t, z_end, t_end) | ||
query = query.replace("distinct(roi.id)", "count(distinct roi.id)") | ||
query = query.replace("select roi", "select count(distinct roi.id)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be an argument to get_query_...()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 8fa122c
Having a |
@pwalczysko You say "As the shapes are ordered inside the ROIs by time, the low-times shapes are at the bottom, the high-time shapes are at the top." but on https://merge-ci.openmicroscopy.org/web/webclient/img_detail/144215/?dataset=25919 I see to opposite: Sorting by T column has no effect since this sorts ROIs not shapes within an ROI. I guess it should do both, but the default Shapes order is at least in order of ascending T as I see it? |
No, not in my hands. See screenshot below from https://merge-ci.openmicroscopy.org/web/webclient/img_detail/144215/?dataset=25919 But this is the same image you are pointing me to. Not sure why do we see different behaviour ? |
For some reason, Firefox showed it in reverse. Not sure exactly why, but I think I fixed it. |
1f07bf7 works as expected now in Firefox, it indeed reversed the order of shapes |
@jburel I think Petr is happy with this now, but you've not had a look in a while. Could you give it a go and see what you think needs doing? Thanks. |
This addresses just the first 2 bullet-points from #335 (comment)
In this PR, when ROIs are paginated (over 500 ROIs), we load just those shapes that are on the current plane.
The ROI JSON includes
shape_count
so we can continue to display that.When an ROI is expanded (either by clicking on the ROI, or when a shape within the ROI is selected), then the Shapes are loaded.
This PR needs ome/omero-marshal#69
To test: