Retrieve Filesize of all images in a given OMERO Project/Dataset

Hi,
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.
Regards,
Laurent

Maybe this page can help you? Details how to use the omero cli to get size information of objects in the repository.

https://docs.openmicroscopy.org/omero/5.6.3/sysadmins/cli/fs.html#detailing-disk-usage

Thanks for the answer. Sadly, i cannot use omero cli. I can only use requests with OMERO API.

Hi @azerty_proxy,

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,
~Josh

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).

Hi,
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

https://omero.lifesci.dundee.ac.uk/webclient/batch_annotate/?image=3989232&image=3989231&image=3989236&image=3989235&image=3989233&image=3989234&image=3989229&image=3989230

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?

Regards,
Will.