RoiWrapper load_shapes includes externalInfo#495
Conversation
sbesson
left a comment
There was a problem hiding this comment.
Performed some initial functional testing using a Mask with an associated ExternalInfo. Without this change, the api/v0/m/rois/ endpoint returns a shallow ExternalInfo object with only the type and the identifier. With this change included, the response includes a populated object.
This retrieval of ExternalInfo objects associated with a shape is consistent with the change proposed and integrated in #453. The performance implications associated with this query had been discussed in the previous PR and similar conclusions apply here. Functionally, it might be worth validating these still hold e.g. using an image with 100s of linked ROI/Shape objects.
How easy is it to add integration tests either at the gateway or at the OMERO.web API level to cover the new functionality?
|
Added a test at ome/openmicroscopy#6455 |
|
All tests passing today: https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/138/testReport/OmeroWeb.test.integration.test_api_rois/ Going to exclude this PR to check that the test fails... |
|
As expected, with this PR excluded the new ExternalInfo checks in test_rois.py are failing: https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/139/testReport/junit/OmeroWeb.test.integration.test_api_rois/TestContainers/test_image_rois/ Removing exclude now... |
|
The integration tests have been properly working over the last few weeks with this included - see https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/157/testReport/junit/OmeroWeb.test.integration.test_api_rois/ The main remaining item is to run some performance testing as mentioned in #495 (review). |
|
Created over 1000 ROIs (each with 10 Rectangles, with externalInfo set on every one) on image in merge-ci server: Max limit of ROIs can be loaded with: Ran a bunch of
E.g (secs) Let's exclude this and test tomorrow without this PR... |
|
full query generated is now: |
|
Timings for the server response on merge-ci with this PR excluded today (secs): About 1 second faster than yesterday. As expected, tests fail with this PR excluded https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/158/testReport/junit/OmeroWeb.test.integration.test_api_rois/TestContainers/test_image_rois/ |
|
I created similar shapes on a different image, this time with NO Having re-deployed omero-web with this PR, we can test whether this PR has any performance hit in the absence of With this query... https://merge-ci.openmicroscopy.org/web/api/v0/m/rois/?image=1276&limit=500 So, performing the query itself has NO performance hit in the absence of |
sbesson
left a comment
There was a problem hiding this comment.
Also retested using a sample image with 1213 associated ROI/Shape objects. Running the two following queries 10 consecutive time
>>> query1="select obj from Roi obj join fetch obj.details.owner as owner left outer join fetch obj.details.externalInfo join fetch obj.details.creationEvent left outer join fetch obj.shapes as shapes left outer join fetch shapes.details.externalInfo where obj.image.id=8134"
>>> query2="select obj from Roi obj join fetch obj.details.owner as owner left outer join fetch obj.details.externalInfo join fetch obj.details.creationEvent left outer join fetch obj.shapes as shapes where obj.image.id=8134"yields the following execution times
- query1: 0.390s +/- 0.042s
- query2: 0.388s +/- 0.041s
I also don't see any performance degradation associated to the additional fetch. Any additional functional testing we would like to perform before integrating this?

Since it is useful to store data in the externalInfo of
shapes, we want to be able to access that via the/roisendpoint.Currently we have the option to
load_shapesbut this doesn't includeexternalInfo(added in this PR).To test:
/api/v0/m/rois/?image=IMAGE_ID/api/v0/m/rois/?image=IMAGE_IDand you should now see this info on the Shape.