[ome-devel] Saving ROIs with Z=T=C=-1
Dominik Lindner (Staff)
d.lindner at dundee.ac.uk
Tue May 8 10:35:21 BST 2018
Hi Alison,
you are right, there is a bug in the Java Gateway classes with
respect to handling of ROIs with Z/C/T < 0, in particular the getters/setters
of the ShapeData class are not consistent and basically prevent setting
negative values.
Unfortunately it's to late to get the fix into 5.4.6, which is going to be released
very soon. But I'll fix this issue for the release after.
As a workaround for now, when dealing with Z/C/T < 0 ROIs, I'd suggest to
use the low-level Ice API directly instead of the ROIFacility, like mentioned in
earlier versions of the Java examples:
https://docs.openmicroscopy.org/omero/5.1.0/developers/Java.html#rois
E.g. create the Ice objects like RoiI and EllipseI directly and save them
via the UpdateService (which can be accessed via gateway.getUpdateService(ctx) ),
And when loading the ROIs, don't trust the ShapeData shape.getZ() etc. but access the
underlying Ice object by e.g.: ((Shape) shape.asIObject()).getTheZ().getValue()
Kind Regards,
Dominik
On 7 May 2018, at 16:13, Alison Walter <wackywalter017 at gmail.com<mailto:wackywalter017 at gmail.com>> wrote:
Hello,
I've noticed some oddities when saving ROIs with Z=T=C= -1 via the
ROIFacility. I'm using OMERO 5.4.
1. Using ROIFacility.saveROIs(...) I get duplicates returned
If I have a ROIData object with one EllipseData shape with Z=T=C= -1,
saving that ROI via saveROIs(...) returns two identical ROIData
objects. Only one ROI is actually saved to the server.
2. Updating a ROI with multiple shapes with Z=T=C= -1 causes some of
the shapes to be lost
If I have a ROIData object with three EllipseData shapes all with
Z=T=C= -1 that I've downloaded, and then I try to save the ROI back to
the server one of those shapes gets deleted. If the ROIData object
hasn't been saved to the server yet, then all the new shapes are
saved.
Here's a link to a gist with some test code:
https://gist.github.com/awalter17/bafb746b97dc21ee91e526b7b5853d42
When using a ROIData object with a single Z=T=C=-1 shape the output I get is:
Number of ROIs loaded: 1
ROIData id: 616
ShapeData id: 585
Number of ROIs saved: 2
ROIData id: 616
ShapeData id: 585
ROIData id: 616
ShapeData id: 585
When using a ROIData object with three shapes at Z=T=C= -1 the output I get is:
Number of ROIs loaded: 1
ROIData id: 618
ShapeData id: 589
ShapeData id: 590
ShapeData id: 591
Number of ROIs saved: 2
ROIData id: 618
ShapeData id: 589
ShapeData id: 590
ShapeData id: 589
ROIData id: 618
ShapeData id: 589
ShapeData id: 590
ShapeData id: 589
Please feel free to let me know if you require any additional
information from me.
Cheers,
Alison
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20180508/49275048/attachment.html>
More information about the ome-devel
mailing list