504 error when requesting image info via JSON API (IDR)

Hi all,

I’m not sure whether this is a problem on my side or not, and hopefully this is not a duplicate thread.
I am trying to gather information from an OMERO server via the JSON API to be able to browse it from QuPath. To do so, I’m requesting all the projects, orphaned datasets and orphaned images present in the specified server (example URLs below). All this works fine for the private server that I have tested it on.

My problem is that requesting image information from the public IDR returns a 504 error (gateway time-out). I’ve used the following link, which returns the 504 error:

http://idr.openmicroscopy.org/api/v0/m/images/

Note that this link works fine:

http://idr.openmicroscopy.org/api/v0/m/datasets/

and so does this one:

http://idr.openmicroscopy.org/api/v0/m/projects/

It might be due to the huge amount of information requested (I believe there are around 100TB of data in the IDR?), but that’s more of a guess than anything else…
If anyone has an idea what is going on I’m all ears :slight_smile:

Thank you in advance,

Melvin

It’ll be due to the number of images. For a large OMERO server like the IDR it doesn’t really make sense to request a full list of images.

Thanks for the quick answer!
It’s true that it doesn’t make much sense to request ALL the images at once.

What I’m actually requesting is the orphaned images in the specified server (that happens to be IDR here). I don’t think there are any in IDR, but I can’t always be sure that this will be the case for other OMERO servers so it has to request that information. Since there aren’t any orphaned image in IDR, I was wondering why the time-out error occurred.

My objective is to re-create a similar tree view to the one on the left side (under Explore) of the screen. This is why I need to request all the projects in the server as well as the orphaned objects. The rest (children) will be requested as the user chooses to open a project (or orphaned object).

If you want a tree view similar to OMERO.insight or webclient, you can use the custom URLs that webclient uses to load this data.
The top-level URL is:

/webclient/api/containers/?id=2&group=3

Where the optional id is to filter by experimenter ID and the group filters by group.
This includes an ‘orphaned’ container with the count of orphaned images.

To get the orphaned images themselves, you can use:

/webclient/api/images/?experimenter_id=2&page=1&orphaned=true&group=3

IDR may contain orphaned images but the webclient UI is configured to not display them.

Hope that helps,

Will

Hi all,

This is a great solution @will-moore, I will experiment a bit with that. I think it should do!
Thanks again,

Melvin

Hi Melvin,

I had actually forgotten that the /api/ methods that you first mentioned also support ?orphaned=true to only show “orphaned” Images, Datasets and Plates. Search this page for “orphaned”: https://docs.openmicroscopy.org/omero/5.6.2/developers/json-api.html

E.g:

/api/v0/m/images/?orphaned=true

Regards,
Will.

1 Like

Hi Will,

Yes, this is what I was originally using to get the ‘orphaned’ images in a given server (as well as ‘orphaned’ datasets and the rest of the data). But unfortunately this times out as well when working with the IDR (http://idr.openmicroscopy.org/api/v0/m/images/?orphaned=true). So going through the custom URL that the webclient uses to load the data seems to be a good solution for now, even though it gives less information about the individual images!