GReD-Clermont / omero_batch-plugin

GNU General Public License v2.0
5 stars 0 forks source link

FillColor/StrokeColor of Shapes are None type #17

Open JensWendt opened 1 year ago

JensWendt commented 1 year ago

Hello again,

It seems that when I upload polygon shapes (I assume with other shapes it is the same issue) from Fiji to OMERO I get FillColor and StrokeColor = None . By itself this seems to be not a big problem as OMERO is displaying it just fine. But if other APIs (I played with ezomero) access this property and expect an integer it can/does lead to problems. As I can see in the docs the class ShapeData again has no distinct way to directly set those colors. Maybe one can play around with setShapeSettings(omero.model.Shape shape), but I am not knowledgable enough to propose a solution.

PS: to achieve the same "look" we now have, the colors would be FillColor = 0 StrokeColor = -1

ppouchin commented 1 year ago

Hi, I do set stroke/fill colors and stroke width, as can be seen in the underlying library. However, the problem might come from ImageJ default values: maybe I should check before copying the values. I'm investigating this.

JensWendt commented 1 year ago

Hi, you are very right. I just tried it out in Fiji. Creating a ROI via WandTool and via rectangle both resulted in ROIs with a default value of None for Stroke-/FillColor. It might prove useful to implement a if (ijRoi.getStrokeColor()==None) data.getShapeSettings().setStroke=-1; (pseudo-code; I dont know java)

ppouchin commented 1 year ago

Using "Simple OMERO Client" version 5.9.3 should also fix this in theory.