[ome-devel] connecting to omero via python

Adam Fraser afraser at broadinstitute.org
Wed Feb 9 20:26:44 GMT 2011


>
>       c = blitzcon.c
>       s = c.sf
>

lol, yup that's pretty much exactly the thing that I was trying to find.
Will pointed me to the BlitzGateway as well and showed me how to do what I
wanted with some other tricks. One was to use
omero.util.script_utils.downloadPlane(RawPixelsStore,
pixels, z,c,t)

Given what you just told me I see that I could do this instead:
blitzcon.c.sf.createGateway().getPlane(pixels_id, z, c, t, _ctx=None)

Sadly, I have no clue what the difference between the two options is except
that I don't need to create a RawPixelsStore object in the latter case. Any
sagely advice for me here?


> But do note that we are in the process of refactoring BlitzGateway to unify
> its
> methods with those in Insight so this API should be considered internal for
> the
> moment. If you have suggestions, we'd love to hear them.
>

Ah, this came up before but I think I misunderstood and thought the
reference was to the other omero.gateway thing (session.createGateway()).
This is definitely very concerning as I don't want to write something that
becomes instantly useless. Should I do what I was doing before with
omero.client(...) and client.createSession(...)?

A few suggestions:

   - Retain as much backwards compatibility as possible.
   - If BlitzGateway is the thing that programmers should use for 90% of
   their needs, then make that obvious in the documentation/wiki somehow.
   - From my perspective, getting images and image metadata is the most
   important thing. So the easier (and faster) that is, the happier I am.

The wiki has been very useful so far, particularly
omeropy/gateway<http://trac.openmicroscopy.org.uk/omero/wiki/OmeroPy/Gateway>.
However,
since I first looked at the
omeropy<http://trac.openmicroscopy.org.uk/omero/wiki/OmeroPy> page,
I got the impression that I should be getting at everything from:
>>>c = omero.client(host)
>>>s = c.createSession(user, pw)
So the first thing I did was start digging:
>>>help(c)
>>>help(s)
...and even now I'm still conflicted as to whether I should just be using
this as opposed to BlitzGateway, I suppose the decision would be easier if
BlitzGateway wasn't in a state of flux.

In the future I'll be wanting to write data back to the database, so I'm
sure I'll have more comments when I cross that bridge.


> Very likely, as soon as the client is inactive for 10 minutes or so. You
> can
> start by using the "omero.keep_alive" property
>

I just discovered I that I can get at all the properties through
blitzcon.c.getPropertyMap(). This is very useful. I don't see a setProperty
function at that level, but could I do something like this?
blitzcon.c.getProperties().setProperty('omero.keep_alive', 123456)

Thanks,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20110209/d8696fd1/attachment.html>


More information about the ome-devel mailing list