Page 1 of 1

Linking Tables to files

PostPosted: Fri Oct 29, 2010 8:37 pm
by icaoberg
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.

Re: Linking Tables to files

PostPosted: Sat Oct 30, 2010 7:41 am
by jmoore
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

Re: Linking Tables to files

PostPosted: Sat Oct 30, 2010 7:52 am
by icaoberg
Got it working. Thanks. Is there a way of getting the whole table as a numpy array?

Re: Linking Tables to files

PostPosted: Sat Oct 30, 2010 11:18 am
by jmoore
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.