Skip to content
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

Mask python training example #4415

Merged
merged 4 commits into from Jan 25, 2016

Conversation

joshmoore
Copy link
Member

@will-moore
Copy link
Member

@joshmoore https://ci.openmicroscopy.org/view/Failing/job/OMERO-DEV-merge-training/214/console failed with

File "/opt/hudson/workspace/OMERO-DEV-merge-training/src/examples/Training/python/ROIs.py", line 141, in <module>
    mask_array = mask_array.tobytes()
AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'

@sbesson
Copy link
Member

sbesson commented Jan 19, 2016

@will-moore: reading the commit history, I suspect 69c1e50e0afe7ee96de114806a1b8e2c145334f6 will fix this failure in tomorrow's build

@will-moore
Copy link
Member

This seems to be working fine.
I'd really like to try and display the mask in web (as on https://trello.com/c/H1MePy2A/124-mask-support-in-web) and wondered if @emilroz had the "reverse" code in hand to get from OMERO into a PIL image (mask) ideally. Otherwise I should be able to work something out, but didn't want to duplicate effort etc.

@emilroz
Copy link
Member

emilroz commented Jan 21, 2016

@will-moore we've have never looked into doing it the other way round (it should be rather straight forward), since the rendering engine has the ability to render the masks. In principle you can request an image with a mask on it from the server. The only problem doing it this way is the fact that it supports only the masks that match the image plane size.

@will-moore
Copy link
Member

@joshmoore I wonder if it's slightly nicer to use something like this instead of random array, since then if you're doing some subsequent work with the mask, you have some idea if it's working/looking right?

# Create [0, 1] mask
def f(x, y):
    return (x * y) % 2
mask_array = numpy.fromfunction(f, (mask_w, mask_h))

@will-moore will-moore mentioned this pull request Jan 22, 2016
Emil pointed out that tobytes has been removed
in later numpy versions since both methods were
identical.
@joshmoore
Copy link
Member Author

Rebased and force pushed on top of 4412 and added @will-moore's non-random mask suggestion.

@will-moore
Copy link
Member

Working fine. Good to merge.

joshmoore added a commit that referenced this pull request Jan 25, 2016
@joshmoore joshmoore merged commit a3f9da3 into ome:develop Jan 25, 2016
@jburel jburel added this to the 5.2.2 milestone Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants