I m looking for a way to get the sum of file sizes (images) in an given OMERO Dataset/Project, using the Omero API.
This information doesn’t seems to be displayed in omero metadata objects.
Maybe this page can help you? Details how to use the omero cli to get size information of objects in the repository.
Thanks for the answer. Sadly, i cannot use omero cli. I can only use requests with OMERO API.
which API are you looking to use? We’ll send some example code similar to https://github.com/ome/omero-py/blob/dab7f1790ec0c0b5f0db0beaf3948b328a41e469/src/omero/plugins/fs.py#L836
All the best,
Hi Josh thanks for your answer. Sorry for the late reply. I m currently using the OMERO web API documented in this page: https://docs.openmicroscopy.org/omero/5.4.5/developers/Modules/Api.html#.
The exemple code you sent me is very close to what i m looking for (ie size of all given images in a given dataset).
Sorry, I’m slightly confused about which API you’re using since you say “web API” but the link is to the OMERO.server API (which you’d use with Java or Python).
If you’re using Python, then the example Josh sent above will be close to what you want.
If you’re using Web/JSON, there’s currently no JSON api that will give you what you want, but you could try scraping one of the URLs for the webclient that is used to display this info in the right panel, under the ‘Download’ option:
For example, passing the Image IDs to the
batch_annotate URL like this, will give you some html
The html will include the tooltip for the Download option like this:
title="Download 8 original imported files (264.2 MB)"
This is not as stable as the Web/Python API, but might be a way to get you the info you need?