Hi Will, <div><br></div><div>Thanks for your response, I would have gotten back to you sooner but I was traveling.<br><br><div class="gmail_quote">On Sat, Feb 5, 2011 at 3:04 AM, Will Moore <span dir="ltr"><<a href="mailto:will@lifesci.dundee.ac.uk">will@lifesci.dundee.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">Hi Adam,<div><br></div><div>Sorry for the confusion, but the connection you're using for most stuff is the 'blitzcon' connection? <br>
</div></div></blockquote><div><br></div><div>No, I was primarily connecting via:</div><div>c = omero.client('<a href="http://ome2-copy.fzk.de">ome2-copy.fzk.de</a>')</div><div>s = c.createSession('afraser', '****')</div>
<div><div>g = s.createGateway()</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div>Or is 'blitzcon' the "second" connection you're using to get Dataset ID?<br>
</div></div></blockquote><div><br></div><div>yup.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div>Confusingly, we have a 'gateway' service in the createSession() connection, but we also refer to the 'blitzcon' connection as omero.gateway</div>
</div></blockquote><div><br></div><div>hrm, I'm definitely confused then because I can do g.getPlane(ID, 0,0,0) with the above gateway, but there's no such getPlane method in what we're calling blitzcon.</div>
<div><br></div><div>Also confusingly, I can get a session from blitzcon, but it's apparently not the same as the type of session I get from omero.clients.BaseClient.createSession(user, password)</div><div><br></div><div>
<div>blitzcon = client_wrapper("afraser", "****", host="<a href="http://ome2-copy.fzk.de">ome2-copy.fzk.de</a>", port=4064)</div><div>blitzcon.connect()</div></div><div>s = blitzcon.getSession()</div>
<div>s.getGateway() #fails</div><div><br></div><div>... of course the only reason I'm trying to get the gateway here is because I need getPlane().</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><br>You want to allow the user to browse their Projects and Datasets by name, to get Dataset ID?<br>You can use the container service to list Projects and Datasets...</div></blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><div>>>> projects = cs.loadContainerHierarchy("Project", None, None)</div>
<div>>>> for p in projects:</div><div>>>> print p.getName().getValue()</div><div>>>> for d in p.linkedDatasetList():</div><div>>>> print d.getName().getValue()</div>
</div></div></blockquote><div><br></div><div>Ok, this would prevent me from having to connect via the blitzcon thing but...</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div><br></div><div>But if you know the name of the Dataset from the start, and you simply want the ID, you CAN use the query service.</div></div></div></blockquote><div><br></div><div>
Hrm, I know _nothing_ about the db schema, so I'd like to avoid this unless it's going to give me a serious performance improvement.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div>Generally you will find it much easier to work with the blitzcon connection.</div></div></div></blockquote><div><br></div><div>Ok, so I should use blitzcon = omero.client_wrapper(...), that's fine. Thanks for clearing this up. I don't want to use the gateway if it's going to change on me, I had the impression it was the right thing to use after reading <a href="http://trac.openmicroscopy.org.uk/omero/wiki/OmeroPy/Gateway">this page</a>.</div>
<div><br></div><div>So here's where this puts me in terms of code:</div><div><br></div><div><div>import omero</div><div>from omero import client_wrapper</div></div><div>import numpy as np</div><div><br></div><div><div>
user = 'xxx'</div><div>pw = 'xxx'</div><div>host = 'xxx'</div><div>project = 'xxx'</div><div>dataset = 'xxx'</div><div><br></div><div>blitzcon = client_wrapper(user, pw, host, port=4064)</div>
<div>blitzcon.connect()</div><div><br></div><div># get all image ids from dataset:</div><div><b>image_ids = #???</b></div><div> </div><div>for image_id in image_ids:</div><div> im = blitzcon.getImage(image_id)</div>
<div> # Get raw image plane.</div><div> # previously: plane = g.getPlane(image_id, 0, 0, 0)</div><div> <b>plane = #???</b></div><div> px = im.getPixels(0)</div><div> h = px.getSizeY().getValue()</div><div>
w = px.getSizeX().getValue()</div><div> imdata = np.array(list(plane))</div><div> imdata.shape = (h,w)</div><div> # now I can do stuff with imdata</div></div><div><br></div><div>Any chance you can help me fill in those 2 blanks?</div>
<div><br></div><div>Thanks again,</div><div>Adam</div></div></div>