[ome-users] Batch import of images AND attachments

Will Moore will at lifesci.dundee.ac.uk
Tue Dec 10 10:37:26 GMT 2013


Hi John,

 A very similar question was asked a while back, so I'll paste the discussion below...

I suggested using a Python script to do the uploading and the subsequent attachment.

I don't have a complete working example, but hopefully there's enough info to get you started.

Perhaps Graeme might have the code that he developed as a solution to this?

  Cheers,

   Will.



On 10 Dec 2013, at 10:26, John Webber (NBI) wrote:

> Hi all,
>  
> I have been using the command line importer to import images into an Omero instance as follows: 
>  
> bin/omero -s $RemoteHost -u "$User" -w "$Password" -p $Port import -d $Dataset $File
>  
> Can anyone let me know if I can also use this format of command to import ATTACHMENTS to specific images and, if so, please can you advise me of the correct syntax?
>  
> If it is not possible to import attachments to specific images, is anyone able to recommend how we can do a batch upload of images AND their attachments, into Omero?
> 
> Thanks
> John



PS. feel free to forward that to the list - forgot to hit reply all


On Thu, May 2, 2013 at 6:18 PM, Graeme Ball <graemeball at googlemail.com> wrote:
Hi Will,

that was a really big help - I would never have found it without the links. I wasn't even sure it would be possible, but it seems quite simple in the end, e.g.:-
    ...
    img = conn.getObject("Image", oid=51)
    fann = conn.createFileAnnfromLocalFile("./some.log", mimetype="text/plain")
    img.linkAnnotation(fann)

and the attachment is there :-)

I didn't really want to write a client/script that would be obsolete as soon as we have OMERO.processing working, but it looks simple enough to be worth doing for the short term.

Thanks again, and I'll be in touch if I run into any further difficulties.

Graeme



On Thu, May 2, 2013 at 4:31 PM, Will Moore <will at lifesci.dundee.ac.uk> wrote:
Hi Graeme,

 Have a look at some python code we use for auto-populating omero with Projects, Datasets and importing Images.
https://github.com/ome/omero-setup/blob/master/auto_import.py

This is something we use to set-up a server for testing etc.

Since you can get the pixels ID from the import process, E.g. see:
https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/test/integration/library.py#L161
you can get the Image ID (can't assume they're the same as in that example) then add some annotations etc (see link below).


For writing your own Python client / scripts etc, you should start
https://www.openmicroscopy.org/site/support/omero4/developers/Python.html

For more detail, try the source code of the "Blitz Gateway" - Python wrappers around the core OMERO api, which
is the 'conn' etc used in many of the starter examples.
https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/src/omero/gateway/__init__.py


 Hope that helps,

 Let us know if you have any more questions,

  Cheers,

  Will. 



On 2 May 2013, at 15:54, Graeme Ball wrote:

> Dear OME,
> 
> I have been writing OMERO scripts to process data and re-import the results, but have hit a couple of snags with the imports.
> 
> I would like to upload results to the same dataset as the images they are derived from, and the command line importer documentation suggests this is possible using the -d option. 
> http://www.openmicroscopy.org/site/support/omero4/users/command-line-import.html
> However, if I try for example, "-d 51" I get:-
>   Unknown debug action: set(['51']) 
> which seems to agree with the contents of OMERO.server/lib/python/omero/cli.py (if that is the right file)
> 
> I would also like to attach results (text files etc.) to each image, but there is no option using the command line importer. The reason I am using the command line importer is that the results are being processed remotely (and we have not managed to set up OMERO.processor as yet). 
> 
> Should I be attempting to write our own python client? And if so, where would be a good place to start? OMERO.server/lib/python/omero/clients.py perhaps?
> 
> Thanks & Best Regards,
> 
> Graeme
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users




>  
>  
>  
> -------------------------------------------------------------------------------------------------------------------------------------------- 
> John Webber
> Computing and Information Services
> NBI Partnership Ltd
> Norwich Research park
> Colney Lane
> Norwich
> NR4 7UH
>  
> E-Mail: john.webber at nbi.ac.uk
> Web:     http://www.nbi.ac.uk
> Tel:         +44(0)1603 450 818
>  
> Helpdesk (Tel):  1234      HPC Support (Web):       http://hpc.nbi.ac.uk  (NBI  internal)
>                                                 HPC Support (Tel):           2003  (NBI internal)
>  
> The NBI Partnership Ltd provides non-scientific services to the Institute of Food Research, the John Innes Centre, The Genome Analysis Centre and The Sainsbury Laboratory
>  
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20131210/b9ae18c3/attachment.html>


More information about the ome-users mailing list