Open emilroz opened 1 year ago
This issue has been mentioned on Image.sc Forum. There might be relevant details there:
https://forum.image.sc/t/batch-roi-export-py-omero-script/84527/5
As something of a first stab in the dark, it might be possible to include a join to the annotations of the shape in ome.services.roi.GeomTool:
though that could potentially add more overhead than you are interested in. At the other end of the spectrum would be to update this method to not work with objects and instead use the raw row information, but that's not going to be particularly fun.
Fetching annotation links and link children was one of the things we tried, but it did not resolve the issue. Not sure if more properties of the child (annotation) have to be fetched.
We did track down the line where the exception occurs: https://github.com/ome/omero-blitz/blob/c500cdf0389b2fd9ef1e5e912279698819682f0e/src/main/java/ome/services/roi/GeomTool.java#L439
Trying to unload the annotation links of the shape before that call also did not prevent the exception.
...I'm being told even more desperate measures were tried to no avail:
List results =
session.createQuery(
"select distinct s from Shape s " +
"left join fetch s.transform t left join fetch s.roi r " +
"left join fetch s.details details " +
"left join details.externalInfo " +
"left outer join fetch s.annotationLinks s_links " +
"left outer join fetch s_link.child as ann " +
"left outer join fetch ann.annotationLinks as al " +
"left outer join fetch al.child " +
"join fetch r.image i join fetch i.pixels p " +
"where s.id in (:ids)").
setParameterList("ids", shapeIds).list();
Ah, and thanks, @knabar. Let me see if that digs up any memories.
Usually IceMapping takes place outside of a transaction since you are in the process of preparing the graph for serialization. This Filter is going to walk through the entire graph when it really shouldn't. If I understand correctly, you tried unloading links here, in the ShapeMapper. But since you are in a transaction, that's a no-no. Would it be possible to just just ignore any of the fieldId's that aren't needed (most notably, annotations!)?
Annotations could absolutely be ignored here, but none of us knew how to go about that
While debugging
Batch ROI Export.py
OMERO.script Glencoe has come across the issue withgetShapeStatsRestricted
call which appears to only work for the Shapes that do not have any annotations. While model allows to link annotations to Shapes there's probably a small number of OMERO.clients that use this functionality, however PathViewer uses it extensively to store additional information about user preferences, etc. which currently makes this call\OMERO.script non functional for any ROIs created with PathViewer or any other client that links annotations to Shapes.Exception details:
Minimal example to reproduce the issue:
/cc @joshmoore @knabar @kkoz