[ome-users] Image Upload and Java API

Ilya Goldberg igg at nih.gov
Thu Jul 13 15:54:50 BST 2006


Hi Nick
What you're trying to do is obviously a common demand, but different  
people want to do this kind of thing in different ways, and so  
different ways evolved to do this.
What's missing though, is an "easy" way to do this.  Maybe you can  
help us come up with a streamlined procedure.  Almost all of the code  
is there to get this done, its really a question of coming up with an  
interface that people feel comfortable with (its no problem to have  
more than one way to do it).

 From various people's requests in a similar vein, I propose the  
following procedure:
0.  Get an OME session (that's pretty standard).

1.  Get the default Repository object (or get the RepositoryID and  
URL as strings)

2.  Upload the entire file directly to OMEIS.  There's a java class  
to do this, but there's not much to it - you're just uploading the  
file in the same way a web-page uploads a file to a server:  multi- 
part form in a POST request.  For example, you can do it with a one- 
liner using the curl program:
curl -F Method=UploadFile -F File=@cb_1.r3d http://localhost/cgi-bin/ 
omeis
OMEIS responds with a FileID (a string, basically).  You can do  
multiple uploads serially or in threads.

3.  Send a command to the OME back-end (via XMLRPC or a simple GET  
request) to import a list of FileIDs into a named OME dataset (i.e.:
ImportUploadedFiles (FileIDs, RepositoryID, 'My Dataset', 'Dataset  
Description')
or, ImportUploadedFiles (FileIDs, RepositoryID, DatasetID)).

Question:  What do you want returned from the ImportUploadedFiles  
call?  Do you need some kind of token to keep track of what  
happened?  The number of images imported from the list of files, a  
list of the resulting ImageIDs, or is a simple status sufficient?

This could literally be done in an afternoon (ha!).
Is this pretty much what you want to do, or do you need something  
else?  Is it simple enough, or do you want this collapsed further  
into a single call?
Do you want to get involved with objects at all, or would you rather  
just retrieve the OMEIS URL and the corresponding ID and deal with  
primitives (i.e. strings).
Since these are very simple calls, do you want to do this using  
XMLRPC, or would you rather just use GET requests? i.e.:
http://my.omeserver.com/perl2/serve.pl? 
Page=OME::ImportUploadedFiles&FileIDs=1,2,34,567&RepositoryID=123&Datase 
tName='My Dataset'&DatasetDescription='My description'

Seriously, let us know what seems most appealing, and you will  
probably have exactly what you want in a few days.

-Ilya



On Jul 13, 2006, at 9:36 AM, Nicholas Lahens wrote:

> Hello again,
> I was wondering if there is any way for a remote client to
> upload local images to the server without having to first
> transfer them to their user directory on the OME machine.
> Secondly, is there a java class (I've been looking through the
> ome-java package) that streamlines image uploads so that I might
> be able to create a program to perform the task of uploading
> local images? I was looking at the VisBio code for clues and I'm
> just curious if there is a less complicated way of doing this
> that I'm missing. As always, thanks for any help you can
> provide.
>
> Nick
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>




More information about the ome-users mailing list