-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add roi utils for creating masks #18
Conversation
If there is an empty intermediate label it's unclear what the correct behaviour should be, so let the user choose between an exception and empty mask
:param t: Optional T-index for the mask | ||
:param text: Optional text for the mask | ||
:param raise_on_no_mask: If True (default) throw an exception if no mask | ||
found, otherwise return an empty Mask |
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.
Not sure what the default should be for raise_on_no_mask
.
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 I read correctly the code, no mask means no non-zero pixels found. Depending on the use case, I can certainly see two behaviors:
- return an empty Mask
- return
None
or throw an exception
The former call is more friendly to the caller of this API as it ensures that a mask is always returned. However from an IDR consumer perspective, I am not sure that there is value in storing an empty Mask rather than no mask. Given this API already has some logic to find bounding boxes, I think raising exception by default but having the possiblity to change the behavior is totally acceptable.
This sounds really useful (I always struggle to create masks for testing) but any pointers on how to use it would be great (without me having to read all the code)? |
@will-moore I documented usage in the python method docs, but as you've pointed out that's displayed anywhere accessible. @sbesson Reckon we could experiment with generating docs on https://readthedocs.org/ ? For testing: |
Same thought as @will-moore, thanks for adding such utilities especially as we re-use the same pieces of code. Main initial feedback is that the Several discussion had been started on a library/plugin to deal with ROIs - see ome/design#80 or IDR/idr-metadata#292. Should we start opening this work in a separate dedicated project e.g. Readthedocs is an interesting idea to use external infrastructure to host Python docs. Requires gaining knowledge so no objection to start experimenting on a new component. |
If we're going for another repo we need to decide whether we want loads of small libraries or something like |
This was moved to https://github.com/ome/omero-rois/tree/v0.2.0 |
Adds two helper methods for creating masks from binary and labelled image arrays.