[ome-devel] Accessing OMERO.insight attachements via the API.

Bernhard Holländer bernhard.hollaender at gmail.com
Mon Jul 20 17:32:34 BST 2009


Hi Jerome!

>From the FileAnnotationI you get the OriginalFileI with the getFile
method. From the OriginalFileI you get its id and initialize a
RawFileStore proxy from it. This has a read method to retrieve the
file content. The size attribute of the OriginalFileI instance tells
you how much you can read.

Example python code:
# file_an is a file annotation from a previos query
org_file = file_an.file
store = session.createRawFileStore()
store.setFileId(org_file.id.val)
# you might want to read the file in blocks and write the blocks to a local file
# here it's the whole file sucked over the wirte in one chunck
data = store.read(0, org_file.size.val)
store.close()

Hope that helps! Bernhard

On Mon, Jul 20, 2009 at 6:15 PM, Jerome Avondo<jeromeavondo at msn.com> wrote:
> Hi,
>
> I have a question regarding file attachments in the OMERO.insight
> application.
> How can I access these using the Java API.
>
> Is this handled internally via the FileAnnotation object?
>
> On a good note I can access the ratings, and tags using the
> linkedAnnotationList() of the Image object but can't seem to access the file
> attachments via the FileAnnotation object.
>
> Any help is welcome,
> thanks,
>
> J.
>
> ________________________________
> Windows Live Messenger: Celebrate 10 amazing years with free winks and
> emoticons. Get Them Now
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>


More information about the ome-devel mailing list