We're Hiring!

Upload/Download OME-Tiff

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.

Re: Upload/Download OME-Tiff

Postby cxallan » Tue Jan 31, 2012 12:03 pm

JakeNewman wrote:When I use the CommandLineImporter, it reports:

Depth: 4 Metadata Level: MINIMUM

and then proceeds to only upload minimal metadata. Is there a way to change the metadata level? I'm using 4.2.2.


You're kind of abusing the command line importer interface slightly by doing things in the manner that you are. I've created an example which uses the lower level import library (which is used by the command line importer) that should cover the use cases and issues that you raised including metadata levels and dataset linkage. It's available here:

https://gist.github.com/1710116

It's using the 4.3.3+ API but it should be close enough to give you an idea of what you need to do.

And for some reason I'm able to set X,Y,C and T using the .setPixelSizeX,Y,C, and T methods on a omexmlservice object, but not Z. So when I upload my image, it always has the same number of Z channels as the source image. Basically, I'm taking a source Tiff, extracting its metadata, attaching it to a new tiff, and uploading it. I'm getting nowhere with setting the Z size so I was thinking of just writing a simple XML parser to adjust it *manually*.

Any ideas?

Jake


Physical pixel sizes or size of the given dimension? Can you post the entire example somewhere so we can see it?
cxallan
Site Admin
 
Posts: 509
Joined: Fri May 01, 2009 8:07 am

Re: Upload/Download OME-Tiff

Postby sgaric » Thu Feb 02, 2012 5:58 am

Hi Chris,

I've been slightly absent from the forums lately due to a break so I have missed some of this discussion. Wanted to let you know that uploading images, like you suggested, using ImportLibrary.importImage() function,
worked as intended. I pretty much got everything working as I want it. One thing is missing for me though, so I was wondering if this is possible with OMERO APIs or not.

During an upload of the image is it possible to get and ID (or handle of some sort) for that image within the OMERO system so that I could refer to it if needed down the track in my code. What I would like to do for example is do some import the image to the server, continue on to do some processing on that image and then attach those results to that image in the OMERO server.

I believe this can be done in two steps already, first upload all the images I am interested in. Then retrieve the images from the server (which will give me the image ID within the OMERO system), do processing and attach the results. I would just like to avoid retrieving the image from the system if that is possible.

Also do you have an example of java/python code where some document is being attached to images/datasets? Are the examples on this page what I should be using for that (about 1/3 down the page) http://trac.openmicroscopy.org.uk/ome/wiki/OmeroJava ?

Regards,
Slavisa
sgaric
 
Posts: 5
Joined: Tue Oct 04, 2011 2:52 am

Re: Upload/Download OME-Tiff

Postby jmoore » Mon Feb 06, 2012 4:01 pm

Hi Slavisa,

sgaric wrote:One thing is missing for me though, so I was wondering if this is possible with OMERO APIs or not.

During an upload of the image is it possible to get and ID (or handle of some sort) for that image within the OMERO system so that I could refer to it if needed down the track in my code. What I would like to do for example is do some import the image to the server, continue on to do some processing on that image and then attach those results to that image in the OMERO server.


The easiest solution is probably to add an import event which will be given the pixel id. For example, you could create an anonymous inner class of the LoggingImportMonitor which handles the event type: IMPORT_DONE:

Code: Select all
    public static class IMPORT_DONE extends PROGRESS_EVENT {
        public final List<Pixels> pixels;
        public IMPORT_DONE(int index, String filename, IObject target,
                Long pixId, int series, ImportSize size, List<Pixels> pixels) {
            super(index, filename, target, pixId, series, size, null, null);
            this.pixels = pixels;
        }
    }


Also do you have an example of java/python code where some document is being attached to images/datasets? Are the examples on this page what I should be using for that (about 1/3 down the page) http://trac.openmicroscopy.org.uk/ome/wiki/OmeroJava ?


Yes. See the section "Create a file annotation and link to an image."

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

Previous

Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 0 guests