<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap:break-word; color:rgb(0,0,0); font-size:14px; font-family:Calibri,sans-serif">
<div>Hi Dan</div>
<div><br>
</div>
<div>First thing, we are going to remove the method</div>
<div>session.createGateway().</div>
<div>Please have a look at&nbsp;<a href="https://trac.openmicroscopy.org.uk/ome/wiki/OmeroMatlab">https://trac.openmicroscopy.org.uk/ome/wiki/OmeroMatlab</a>&nbsp;to see how to load images, read data etc.</div>
<div><br>
</div>
<div>To load the channel information</div>
<div>You will have to do the following (pseudo –code) I will that example to the page.</div>
<div>svc = session.getPixelsService() /</div>
<div>Pixels pixels = svc.<span class="Apple-style-span" style="font-size:11px; font-family:Monaco,sans-serif">retrievePixDescription</span>(pixelsID)</div>
<div>Pixels.copyChannels() will return &nbsp;the channels loaded.</div>
<div><br>
</div>
<div>Jmarie</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; border-bottom:medium none; border-left:medium none; padding-bottom:0in; padding-left:0in; padding-right:0in; border-top:#b5c4df 1pt solid; border-right:medium none; padding-top:3pt">
<span style="font-weight:bold">From: </span>Dan Withey &lt;<a href="mailto:DWithey@csir.co.za">DWithey@csir.co.za</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Fri, 3 Feb 2012 18:43:20 &#43;0200<br>
<span style="font-weight:bold">To: </span>&lt;<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>[ome-devel] Channel data from Matlab<br>
</div>
<div><br>
</div>
<div>
<div style="margin:4px 4px 1px; font:10pt Tahoma">
<div>Hello,</div>
<div>&nbsp;</div>
<div>Is there a way to access image channel data using Matlab? When attempting this, the following error is reported:</div>
<div>&nbsp;</div>
<div>Error using omero.model.PixelsI/getChannel<br>
Java exception occurred:<br>
omero.UnloadedCollectionException: Error updating collection:channelsSeq<br>
Collection is currently null. This can be seen<br>
by testing &quot;channelsSeqLoaded&quot;. This implies<br>
that this collection was unloaded. Please refresh this object<br>
in order to update this collection.<br>
</div>
<div>&nbsp;</div>
<div>Here's the code:</div>
<div>&nbsp;</div>
<div>client = loadOmero(url); </div>
<div>&nbsp;</div>
<div>session = client.createSession(user, password);<br>
gateway = session.createGateway();<br>
timer = omeroKeepAlive(client); % Creates and starts a 60 second timer.<br>
userId = session.getAdminService().getEventContext().userId;</div>
<div>&nbsp;</div>
<div>ContainerProxy = session.getContainerService();</div>
<div>&nbsp;</div>
<div>params = omero.sys.ParametersI();<br>
params.leaves();%indicate to load the images<br>
params.exp(omero.rtypes.rlong(userId));</div>
<div>&nbsp;</div>
<div>projectsList = ContainerProxy.loadContainerHierarchy(char('omero.model.Project'), [], params);<br>
p = projectsList.get(0);</div>
<div>&nbsp;</div>
<div>datasetsList = p.linkedDatasetList;<br>
d = datasetsList.get(0);</div>
<div>&nbsp;</div>
<div>imageList = d.linkedImageList;<br>
image = imageList.get(0);</div>
<div>&nbsp;</div>
<div>pixelsList = image.copyPixels();<br>
pixels = pixelsList.get(0);</div>
<div>&nbsp;</div>
<div>pixels.getChannel(0);<br>
</div>
<div>&nbsp;</div>
<div>Thanks!</div>
<div>Dan</div>
<font face="Verdana,Arial,Helvetica,Trebuchet MS" size="1"><br>
-- <br>
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
<br>
The full disclaimer details can be found at <a href="http://www.csir.co.za/disclaimer.html">
http://www.csir.co.za/disclaimer.html</a>. </font>
<p><font face="Verdana,Arial,Helvetica,Trebuchet MS" size="1"><br>
This message has been scanned for viruses and dangerous content by <a href="http://www.mailscanner.info/">
<b>MailScanner</b></a>, <br>
and is believed to be clean. </font></p>
</div>
</div>
_______________________________________________ ome-devel mailing list <a href="mailto:ome-devel@lists.openmicroscopy.org.uk">
ome-devel@lists.openmicroscopy.org.uk</a> <a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a> </span><br>
The University of Dundee is a registered Scottish Charity, No: SC015096
</body>
</html>