Closed JensWendt closed 1 year ago
Hi Jens, I don't have an easy way to test this, but the version on the latest PR (#64) should solve this - can you test it and see if it works for you?
Hi @erickmartins , it seems to do the job. I uploaded the ROIs in the same way as before. Now
roi_service = conn.getRoiService()
roiList = roi_service.findByImage(2874,None).rois
for roi in roiList:
FillColor = roi._shapesSeq[0].getFillColor()
StrokeColor = roi._shapesSeq[0].getStrokeColor()
StrokeWidth = roi._shapesSeq[0].getStrokeWidth()
print("FillColor ",FillColor," StrokeColor ", StrokeColor," StrokeWidth ", StrokeWidth)
gives me:
FillColor None StrokeColor None StrokeWidth 0.0 POINT
I assume the "POINT" is the optional length unit that the official documentation of omero model is reffering to
StrokeWidth - the width of the stroke in pixels (optional). This also has an optional length unit, StrokeWidthUnit.
and with ezomero:
roilist = ezom.get_roi_ids(conn, 2874)
for roiId in roilist:
shapeId = ezom.get_shape_ids(conn, roiId)[0]
shape = ezom.get_shape(conn, shapeId)
print("FillColor ",shape[1]," StrokeColor ", shape[2]," StrokeWidth ", shape[3])
gives me:
FillColor (0, 0, 0, 0) StrokeColor (0, 0, 0, 0) StrokeWidth 0.0
I cannot really judge the StrokeWidth fix as 0.0 is not None.
Looks good to me, overall
Alright, thanks a lot! We'll merge it soon and release a new version with the fix.
Describe the bug While calling
get_shape(conn, id)
, if the Shape hasFillColor = None
it leads to aTypeError
in_int_to_rgba(omero_val)
.To Reproduce Upload generated ROIs via https://github.com/GReD-Clermont/omero_batch-plugin from Fiji. As far as I tried you cannot generate FillColor
None
in OMERO itself, only 0. Therefore it might be a fringe exception, but nevertheless interesting that it can happen.Expected behavior Maybe catch the
None
type and treat it as a 0 because that is how it is displayed (as rgba(0, 0, 0, 0) ) in OMERO.Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Error message: