We're Hiring!

retrieve data from file annotation

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.

retrieve data from file annotation

Postby ebbwdan » Thu Jul 03, 2014 6:04 am

Hi,

I was wondering what would be the best way of reading numeric data from a file annotation (csv, columns of numbers) on an Omero server via a script. So, the file is uploaded to the server and the script accesses the data in that file. I would like to work purely in Python (omero-csv-tools seems to do something similar but in Java) and I assumed I could use the BlitzGateway connection. I very naively thought I could get the path on the server to the original file and then give that to something like numpy.genfromtxt ...

We are in the process of getting our Omero server up and running within a cloud service which is going to be backed up with some hefty resources so I am looking at running some analysis inside the server (both image and purely numeric data which is annotated to images). Ideally I would like to turn files of columnar numeric data into Omero.tables on import but it seems like this needs to be done in two steps - annotate an image first and then convert some/all the data in the file to HDF5?

Many thanks in advance for any pointers!

Cheers,

Dan.
ebbwdan
 
Posts: 61
Joined: Wed Aug 29, 2012 4:46 am

Re: retrieve data from file annotation

Postby PaulVanSchayck » Thu Jul 03, 2014 9:15 am

Hey Dan,

I was wondering what would be the best way of reading numeric data from a file annotation (csv, columns of numbers) on an Omero server via a script. So, the file is uploaded to the server and the script accesses the data in that file. I would like to work purely in Python (omero-csv-tools seems to do something similar but in Java) and I assumed I could use the BlitzGateway connection. I very naively thought I could get the path on the server to the original file and then give that to something like numpy.genfromtxt ...

This is most certainly possible. What have you tried so far?
Take a look at:
http://downloads.openmicroscopy.org/ome ... nnotations
http://downloads.openmicroscopy.org/ome ... class.html
http://downloads.openmicroscopy.org/ome ... class.html

Kind regards,

Paul
PaulVanSchayck
 
Posts: 41
Joined: Tue May 20, 2014 7:04 am

Re: retrieve data from file annotation

Postby jmoore » Thu Jul 03, 2014 1:00 pm

Just adding to Paul's answer, your options as I can see them are:

  • Download the files as Paul describes.
  • Access the files locally via scripts. This is not a suggested method, but there are certainly sites which have done something similar.
  • Put the tabular data into OMERO.tables as you mention. The importer is currently OMERO.tables agnostic, so yes, you'd have to perform a post-processing step of some kind to attach the OMERO.tables.

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

Re: retrieve data from file annotation

Postby ebbwdan » Thu Jul 03, 2014 11:33 pm

Hi Paul and Josh,

Many thanks for the quick responses! I realised what the solution was just after I posted my message; I guess just asking the question made me realise where I was going wrong. I was trying to get that path on the server which wasn't a good idea.

The solution was staring me in the face on this page:

https://www.openmicroscopy.org/site/sup ... ython.html

I 'download' the file to some temp location on the server, then parse the file with numpy, and put the data I want in a table and then destroy the temp location.

Cheers,

Dan.
ebbwdan
 
Posts: 61
Joined: Wed Aug 29, 2012 4:46 am


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest