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

Add annotation examples from saeri scripts #2010

Merged
merged 6 commits into from
Dec 4, 2019

Conversation

will-moore
Copy link
Member

Add missing examples to the OMERO Python page, based on code needed by @ilamarengo

See #2009

cc @jburel, @pwalczysko


for ann in project.listAnnotations():
print ann.getId(), ann.OMERO_TYPE,
print " added by ", ann.link.getDetails().getOwner().getOmeName()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes properties are hidden behind "getDetails()", in other cases, they are not. Is there a way to get my head around this ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't know the best way to clarify this. Details are not specific to any particular object. All objects have details and owner (except Group and Experimenter) but other properties e.g. name or strokeWidth are specific to certain objects.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link.save()

# Find Annotations linked to Object(s), filtering by namespace optional
for link in conn.getAnnotationLinks('Image', parent_ids=image_ids, ns=namespace):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespace - I might know what that is, but still, no idea what types and usages there are (client-editable namespace for KVPs, some other special namespaces ... ?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good spot (within a code block) to describe namespace usage in more detail. But not sure of the best place to point to either.


tag_ann = omero.gateway.TagAnnotationWrapper(conn)
tag_ann.setTextValue("Not owned by me")
# update details of the wrapped omero.model.AnnotationI _obj
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess that the whole "wrapped objects" workflow and syntax is explained somewhere else in this doc or another doc ? (the underscore with a ... space ?) Definitely a point which warrants more attention I guess.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is explained in a bit more detail above and further at https://docs.openmicroscopy.org/omero/5.5.1/developers/PythonBlitzGateway.html

@pwalczysko
Copy link
Member

I think this sentence is not accurate - https://github.com/ome/ome-documentation/pull/2010/files#diff-3bd9f4e3933d8044e9084726276de4cbR14 - we do not describe anything more about BlitzGateway on this page. Instead, this is all described in another, linked page ?

@pwalczysko
Copy link
Member

Here, https://github.com/ome/ome-documentation/pull/2010/files#diff-3bd9f4e3933d8044e9084726276de4cbR34 the link directly to the Ice part of the doc should be given - to minimize the confusion.

@pwalczysko
Copy link
Member

Here, https://github.com/ome/ome-documentation/pull/2010/files#diff-3bd9f4e3933d8044e9084726276de4cbR17
Replace OMERO_HOME with wording like "in the OMERO.server directory" - maybe also explaining that this is the OMERO.server you downloaded in the first sentence (not just after this one).

@pwalczysko
Copy link
Member

Couple of new comments, the fixed changes look good.

omero/developers/Python.rst Outdated Show resolved Hide resolved
print "\nAnnotations on Dataset:", dataset.getName()
for ann in dataset.listAnnotations():
namespace = "imperial.training.demo"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or something more generic?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@will-moore : did you see this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks

@joshmoore
Copy link
Member

2 comments above. Otherwise, good to get this in.

(My only question would likely be whether or not these should be part of the examples so that they are regularly tested.)

will-moore and others added 2 commits November 25, 2019 17:10
Co-Authored-By: Mark Carroll <m.t.b.carroll@dundee.ac.uk>
@will-moore
Copy link
Member Author

I started porting some examples to Training...

will-moore added a commit to will-moore/openmicroscopy that referenced this pull request Nov 27, 2019
@will-moore
Copy link
Member Author

Added examples to Training at ome/openmicroscopy#6187
If this is good to merge, please go ahead. Otherwise I can list again tomorrow...

@ilamarengo
Copy link

ilamarengo commented Nov 29, 2019 via email

@will-moore
Copy link
Member Author

Hi Ilaria,

Apologies for not replying to your e-mail earlier.
Your scripts should be fine to run in Python 3 on the OMERO 5.6.0 server.
They might need 1 or 2 fixes but I expect that to be quite minimal. Most of the changes we've had to make for Python 3 have been reading/writing files, division of numbers etc.
So, probably the reading/writing of csv files will be the biggest fix.
E.g. changes to Batch_Image_Export script https://github.com/ome/omero-scripts/pull/159/files#diff-a5c72ab8f196397473c89460868f64d4

But in general, I would try to run the scripts as they are and see if you get any errors.
And let us know if you have any problems.

Cheers,

Will

@ilamarengo
Copy link

ilamarengo commented Dec 2, 2019 via email

@joshmoore joshmoore merged commit b094989 into ome:develop Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants