We're Hiring!

Linking Tables to files

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.

Linking Tables to files

Postby icaoberg » Fri Oct 29, 2010 8:37 pm

I was able to create an H5 file but now I want to link the table to the image file. How do I do it? I kind of last because FileAnnotation is an abstract class.
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Linking Tables to files

Postby jmoore » Sat Oct 30, 2010 7:41 am

All the omero.model classes generated by Ice are abstract, but for all of them there is a concrete subclass ending with an "I".
Code: Select all
image = omero.model.ImageI(imageID, False)
fileAnnotation = omero.model.FileAnnotationI()
annotationLink = omero.model.ImageAnnotationLinkI()
annotationLink.link(image, fileAnnotation)
fileAnnotation.file = omero.model.OriginalFileI(fileID, False)

annotationLink = updateServicePrx.saveAndReturnObject(annotationLink)



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

Re: Linking Tables to files

Postby icaoberg » Sat Oct 30, 2010 7:52 am

Got it working. Thanks. Is there a way of getting the whole table as a numpy array?
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Linking Tables to files

Postby jmoore » Sat Oct 30, 2010 11:18 am

icaoberg wrote:Got it working. Thanks.


Good to hear.

icaoberg wrote: Is there a way of getting the whole table as a numpy array?


Not on the client-side at the moment, no. You might take a look at the omero.columns module which handles the backend mapping to numpy and HDF5. If there's anything you can re-use, then we can go about making it more generally usable.

~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: No registered users and 1 guest