We're Hiring!

Matlab and PE Columbus

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Matlab and PE Columbus

Postby tjc@mcmaster.ca » Mon Jan 30, 2012 7:04 pm

Hi Folks,
We have the Perkin Elmer's Columbus/OMERO to manage our screening data. I'd like to be able to pull images from Columbus/Omero from within matlab for analysis.

I'm walking through the matlab/Omero faq's and how-to's online but not making much progress. When I run the code below I get the error beneath. I thought I should check with the experts that that what I'm trying is actually feasible with Columbus/Omero before chasing this down to network permissions or poor code.
(I can use log in to Columbus via this account using the Columbus/Omero webclient).
Cheers,
Tony

MATLAB code:
loadOmero;
username='guest';
password='tmppass';
server='fhscolumbus.csu.mcmaster.ca';
client = omero.client(server, 4064);
session = client.createSession(username, password);

etc. from http://trac.openmicroscopy.org.uk/ome/wiki/OmeroMatlab

Error:

OmeroMatlab Toolbox
4.3.2-8fc94b85-b2882
--------------------------
1/30/12 14:00:44:663 warning: main: null - createSession retry: 1
1/30/12 14:00:49:670 warning: main: null - createSession retry: 2
??? Java exception occurred:
omero.ClientError: Obtained null object proxy
at omero.client.createSession(client.java:643)
Error in ==> GetImage at 8
session = client.createSession(username, password);
tjc@mcmaster.ca
 
Posts: 4
Joined: Mon Jan 30, 2012 6:43 pm

Re: Matlab and PE Columbus

Postby jmoore » Mon Jan 30, 2012 7:42 pm

Hi Tony,

Current versions of Columbus use OMERO 4.1. Unfortunately, the current examples use 4.3 or later. Between those two versions, the default port changed from 4063 (non-SSL) to 4064 (SSL) which is why you're getting this rather strange error.

To continue moving forward, you'll need to have the 4.1 omero_client.jar and change the port to 4063. If and when you run into specific issues with API differences between the two versions, let us know.

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Matlab and PE Columbus

Postby tjc@mcmaster.ca » Tue Jan 31, 2012 1:41 pm

That's great. Further forward now.
Thanks,
Tony
tjc@mcmaster.ca
 
Posts: 4
Joined: Mon Jan 30, 2012 6:43 pm

Re: Matlab and PE Columbus

Postby tjc@mcmaster.ca » Tue Jan 31, 2012 2:05 pm

Hi,
Spoke to soon. I can get the list of projects returned properly but not the Screens.
When I try the line:
screenList = proxy.loadContainerHierarchy(omero.model.Screen.class, [], param);


I get :

??? Java exception occurred:
omero.ApiUsageException

serverStackTrace = "ome.conditions.ApiUsageException: Invalid path: 'img.pixels' [select this from ome.model.screen.Screen this left
outer join fetch this.plateLinks pdl left outer join fetch pdl.child ds left outer join fetch this.annotationLinksCountPerOwner
this_a_c left outer join fetch img.pixels as pix left outer join fetch pix.pixelsType as pt ]; nested exception is
org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'img.pixels' [select this from ome.model.screen.Screen this left outer join
fetch this.plateLinks pdl left outer join fetch pdl.child ds left outer join fetch this.annotationLinksCountPerOwner this_a_c left
outer join fetch img.pixels as pix left outer join fetch pix.pixelsType as pt ]

at
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642)

at
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)

at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)

at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)

at ome.logic.QueryImpl.execute(QueryImpl.java:137)

at ome.logic.PojosImpl.loadContainerHierarchy(PojosImpl.java:125)

at sun.reflect.GeneratedMethodAccessor1397.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)

at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

at ome.security.basic.EventHandler.invoke(EventHandler.java:133)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:175)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:100)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

at $Proxy73.loadContainerHierarchy(Unknown Source)

at sun.reflect.GeneratedMethodAccessor1397.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)

at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

at ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:78)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:35)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

at $Proxy73.loadContainerHierarchy(Unknown Source)

at sun.reflect.GeneratedMethodAccessor1400.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at ome.services.blitz.util.IceMethodInvoker.callOrClose(IceMethodInvoker.java:257)

at ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:179)

at ome.services.throttling.Callback.run(Callback.java:55)

at ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:37)

at ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:115)

at ome.services.blitz.impl.ContainerI.loadContainerHierarchy_async(ContainerI.java:179)

at omero.api._IContainerTie.loadContainerHierarchy_async(_IContainerTie.java:134)

at omero.api._IContainerDisp.___loadContainerHierarchy(_IContainerDisp.java:194)

at omero.api._IContainerDisp.__dispatch(_IContainerDisp.java:637)

at IceInternal.Incoming.invoke(Incoming.java:159)

at Ice.ConnectionI.invokeAll(ConnectionI.java:2037)

at Ice.ConnectionI.message(ConnectionI.java:972)

at IceInternal.ThreadPool.run(ThreadPool.java:577)

at IceInternal.ThreadPool.access$100(ThreadPool.java:12)

at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)

"

serverExceptionClass = "ome.conditions.ApiUsageException"

message = "Invalid path: 'img.pixels' [select this from ome.model.screen.Screen this left outer join fetch this.plateLinks pdl left
outer join fetch pdl.child ds left outer join fetch this.annotationLinksCountPerOwner this_a_c left outer join fetch img.pixels as pix
left outer join fetch pix.pixelsType as pt ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Invalid path:
'img.pixels' [select this from ome.model.screen.Screen this left outer join fetch this.plateLinks pdl left outer join fetch pdl.child
ds left outer join fetch this.annotationLinksCountPerOwner this_a_c left outer join fetch img.pixels as pix left outer join fetch
pix.pixelsType as pt ]"

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2243)

at IceInternal.BasicStream.throwException(BasicStream.java:1632)

at IceInternal.Outgoing.throwUserException(Outgoing.java:442)

at omero.api._IContainerDelM.loadContainerHierarchy(_IContainerDelM.java:592)

at omero.api.IContaine

Error in ==> GetImage at 31
screenList = proxy.loadContainerHierarchy(omero.model.Screen.class, [], param);

[ 1/31/12 08:58:55:876 ClientCallback: sessionClosed run ]

[ 1/31/12 09:01:25:883 ClientCallback: sessionClosed run ]
tjc@mcmaster.ca
 
Posts: 4
Joined: Mon Jan 30, 2012 6:43 pm

Re: Matlab and PE Columbus

Postby jmoore » Mon Feb 06, 2012 10:56 am

tjc@mcmaster.ca wrote:Hi,
Spoke to soon. I can get the list of projects returned properly but not the Screens.
When I try the line:
screenList = proxy.loadContainerHierarchy(omero.model.Screen.class, [], param);


This is a server-side error, but I'm not sure of the cause. What were the params you passed in? For some reason, it's producing this incorrect HQL query:

Code: Select all
select this from ome.model.screen.Screen this left outer join
    fetch this.plateLinks pdl left outer join fetch pdl.child ds left outer join fetch this.annotationLinksCountPerOwner this_a_c left
    outer join fetch img.pixels as pix left outer join fetch pix.pixelsType as pt


To workaround this issue, you can run this query, fixed, yourself. For example,

Code: Select all
iQuery = session.getQueryService();
screenList = iQuery.findAllByQuery("select this from Screen this left outer join fetch this.plateLinks links left outer join fetch links.child plates", param);


would load the screens and plate, and then you would need to load the lower objects (wells, images).

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Matlab and PE Columbus

Postby tjc@mcmaster.ca » Mon Feb 06, 2012 8:28 pm

That's great. I can get the list of screens now with the code below. Commenting out the screenList call that gave the error.Thanks to your helpa nd the website I've got a list of screens then pulled a list of paltes from the screen of choice but not it errs when i try to pull the measurement/acquisition list for the plate.

Here's the error and the code below.
??? No appropriate method, property, or field copyPlateAcquisitions for class omero.model.PlateI.

Error in ==> GetImage at 43
plateAcquisitionList = plate.copyPlateAcquisitions();

Thanks,
Tony




loadOmero;
client = omero.client(server, 4063);
session = client.createSession(username, password);

proxy = session.getContainerService();

param = omero.sys.ParametersI();
param.leaves();
userId = session.getAdminService().getEventContext().userId;
param.exp(omero.rtypes.rlong(userId));

%screenList = proxy.loadContainerHierarchy(omero.model.Screen.class, [], param);

iQuery = session.getQueryService();
screenList = iQuery.findAllByQuery('select this from Screen this left outer join fetch this.plateLinks links left outer join fetch links.child plates', param);

screens=cell(screenList.size()-1,1);
for j = 0:screenList.size()-1,
s = screenList.get(j);
sName = s.getName().getValue();
screens(j+1,1) = java.lang.String(sName);
end

screen = screenList.get(1);% using screen 1 as an example
sName= screen.getName().getValue();
platesList = screen.linkedPlateList;
plates=cell(platesList.size()-1,1);

for i = 0:platesList.size()-1,
plate = platesList.get(i);
pName=plate.getName().getValue();
plates(i+1,1)=java.lang.String(pName);
end

plate = platesList.get(2);% using plate 2 as an example
pName=plate.getName().getValue();
plateAcquisitionList = plate.copyPlateAcquisitions();
tjc@mcmaster.ca
 
Posts: 4
Joined: Mon Jan 30, 2012 6:43 pm

Re: Matlab and PE Columbus

Postby jmoore » Mon Feb 06, 2012 8:39 pm

tjc@mcmaster.ca wrote:Here's the error and the code below.
??? No appropriate method, property, or field copyPlateAcquisitions for class omero.model.PlateI.

Error in ==> GetImage at 43
plateAcquisitionList = plate.copyPlateAcquisitions();


Glad to have gotten you this far. In 4.1, however, there are no plate acquisitions. Instead there were screen acquisitions (linking screens to well samples), and Columbus uses them in something of a non-traditional way, so it may take some experimenting to find just the data you want.

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest