New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polygon python training example #4412
Polygon python training example #4412
Conversation
Also broke multi-shape ROI into several smaller ROIs, with single shape each in case someone wants to view result in Insight
""" Returns strange format supported by Insight """ | ||
points = ["%s,%s" % (p[0], p[1]) for p in points] | ||
csv = ", ".join(points) | ||
return "points[%s] points1[%s] points2[%s]" % (csv, csv, csv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need to set it to something other than what's described at http://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2015-01/ROI_xsd.html#Polygon_Points then we probably need a card.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objections to my adding a mask example here? |
Please do! (in another PR you mean)? |
Yup, I'll build on this commit but re-use the |
I would reuse |
Comment from http://lists.openmicroscopy.org.uk/pipermail/ome-users/2016-January/005807.html |
The previous commit added support for Alpha, but if I try to set alpha > 127 (50%) for strokeColor then I get this error:
Any ideas what I'm doing wrong here? |
http://www.openmicroscopy.org/Schemas/Documentation/Generated/OME-2015-01/ROI_xsd.html#Shape_FillColor and its kin specify a signed 32 bit value: if alpha > 127 then do you need to subtract to make the most significant bit act like a sign bit? Just as my example from http://lists.openmicroscopy.org.uk/pipermail/ome-users/2016-January/005803.html had #C4C4C4C4 represented by -993737532. |
Hmmm - I wonder if anyone knows straight off how to convert from unsigned 32 bit to signed? Don't really want to spend a day trying to research 2's complement (or whatever) and work it out in python. Do we have code to do this in Java anywhere? |
If the number is larger than 2^31-1 then subtract 2^32 from it. |
Thanks @mtbc. Script is working now with range of alpha values. |
Makes sense to me and works for me locally. Merging and I'll 1) remark on the list thread and 2) update by PR to not include your commits. |
Polygon python training example
Improve ROIs examples in python with new Polygon example and setting of strokeWidth and stroke + fill colours. See http://lists.openmicroscopy.org.uk/pipermail/ome-users/2016-January/005804.html
To test, review and run the example.