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">&lt;<a href="mailto:will@lifesci.dundee.ac.uk">will@lifesci.dundee.ac.uk</a>&gt;</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&#39;re using for most stuff is the &#39;blitzcon&#39; connection? <br>

</div></div></blockquote><div><br></div><div>No, I was primarily connecting via:</div><div>c = omero.client(&#39;<a href="http://ome2-copy.fzk.de">ome2-copy.fzk.de</a>&#39;)</div><div>s = c.createSession(&#39;afraser&#39;, &#39;****&#39;)</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 &#39;blitzcon&#39; the &quot;second&quot; connection you&#39;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 &#39;gateway&#39; service in the createSession() connection, but we also refer to the &#39;blitzcon&#39; connection as omero.gateway</div>

</div></blockquote><div><br></div><div>hrm, I&#39;m definitely confused then because I can do g.getPlane(ID, 0,0,0) with the above gateway, but there&#39;s no such getPlane method in what we&#39;re calling blitzcon.</div>

<div><br></div><div>Also confusingly, I can get a session from blitzcon, but it&#39;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(&quot;afraser&quot;, &quot;****&quot;, host=&quot;<a href="http://ome2-copy.fzk.de">ome2-copy.fzk.de</a>&quot;, 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&#39;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>&gt;&gt;&gt; projects = cs.loadContainerHierarchy(&quot;Project&quot;, None, None)</div>

<div>&gt;&gt;&gt; for p in projects:</div><div>&gt;&gt;&gt;        print p.getName().getValue()</div><div>&gt;&gt;&gt;        for d in p.linkedDatasetList():</div><div>&gt;&gt;&gt;             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&#39;d like to avoid this unless it&#39;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&#39;s fine. Thanks for clearing this up. I don&#39;t want to use the gateway if it&#39;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&#39;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 = &#39;xxx&#39;</div><div>pw = &#39;xxx&#39;</div><div>host = &#39;xxx&#39;</div><div>project = &#39;xxx&#39;</div><div>dataset = &#39;xxx&#39;</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>