<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Alison,
<div class=""><br class="">
</div>
<div class="">you are right, there is a bug in the Java Gateway classes with </div>
<div class="">respect to handling of ROIs with Z/C/T < 0, in particular the getters/setters </div>
<div class="">of the ShapeData class are not consistent and basically prevent setting </div>
<div class="">negative values. </div>
<div class="">Unfortunately it's to late to get the fix into 5.4.6, which is going to be released </div>
<div class="">very soon. But I'll fix this issue for the release after.</div>
<div class=""><br class="">
</div>
<div class="">As a workaround for now, when dealing with Z/C/T < 0 ROIs, I'd suggest to </div>
<div class="">use the low-level Ice API directly instead of the ROIFacility, like mentioned in </div>
<div class="">earlier versions of the Java examples:</div>
<div class=""> <a href="https://docs.openmicroscopy.org/omero/5.1.0/developers/Java.html#rois" class="">https://docs.openmicroscopy.org/omero/5.1.0/developers/Java.html#rois</a> </div>
<div class=""><br class="">
</div>
<div class="">E.g. create the Ice objects like RoiI and EllipseI directly and save them</div>
<div class="">via the UpdateService (which can be accessed via gateway.getUpdateService(ctx) ), </div>
<div class=""><br class="">
</div>
<div class="">And when loading the ROIs, don't trust the ShapeData shape.getZ() etc. but access the </div>
<div class="">underlying Ice object by e.g.: ((Shape) shape.asIObject()).getTheZ().getValue()</div>
<div class=""><br class="">
</div>
<div class="">Kind Regards,</div>
<div class="">Dominik</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 7 May 2018, at 16:13, Alison Walter <<a href="mailto:wackywalter017@gmail.com" class="">wackywalter017@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hello,<br class="">
<br class="">
I've noticed some oddities when saving ROIs with Z=T=C= -1 via the<br class="">
ROIFacility. I'm using OMERO 5.4.<br class="">
<br class="">
1. Using ROIFacility.saveROIs(...) I get duplicates returned<br class="">
<br class="">
If I have a ROIData object with one EllipseData shape with Z=T=C= -1,<br class="">
saving that ROI via saveROIs(...) returns two identical ROIData<br class="">
objects. Only one ROI is actually saved to the server.<br class="">
<br class="">
2. Updating a ROI with multiple shapes with Z=T=C= -1 causes some of<br class="">
the shapes to be lost<br class="">
<br class="">
If I have a ROIData object with three EllipseData shapes all with<br class="">
Z=T=C= -1 that I've downloaded, and then I try to save the ROI back to<br class="">
the server one of those shapes gets deleted. If the ROIData object<br class="">
hasn't been saved to the server yet, then all the new shapes are<br class="">
saved.<br class="">
<br class="">
Here's a link to a gist with some test code:<br class="">
<a href="https://gist.github.com/awalter17/bafb746b97dc21ee91e526b7b5853d42" class="">https://gist.github.com/awalter17/bafb746b97dc21ee91e526b7b5853d42</a><br class="">
<br class="">
When using a ROIData object with a single Z=T=C=-1 shape the output I get is:<br class="">
<br class="">
Number of ROIs loaded: 1<br class="">
ROIData id: 616<br class="">
ShapeData id: 585<br class="">
<br class="">
Number of ROIs saved: 2<br class="">
ROIData id: 616<br class="">
ShapeData id: 585<br class="">
<br class="">
ROIData id: 616<br class="">
ShapeData id: 585<br class="">
<br class="">
When using a ROIData object with three shapes at Z=T=C= -1 the output I get is:<br class="">
<br class="">
Number of ROIs loaded: 1<br class="">
ROIData id: 618<br class="">
ShapeData id: 589<br class="">
ShapeData id: 590<br class="">
ShapeData id: 591<br class="">
<br class="">
Number of ROIs saved: 2<br class="">
ROIData id: 618<br class="">
ShapeData id: 589<br class="">
ShapeData id: 590<br class="">
ShapeData id: 589<br class="">
<br class="">
ROIData id: 618<br class="">
ShapeData id: 589<br class="">
ShapeData id: 590<br class="">
ShapeData id: 589<br class="">
<br class="">
Please feel free to let me know if you require any additional<br class="">
information from me.<br class="">
<br class="">
Cheers,<br class="">
Alison<br class="">
_______________________________________________<br class="">
ome-devel mailing list<br class="">
ome-devel@lists.openmicroscopy.org.uk<br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>