Browsing the Open Microscopy Image Data Resource with Python#

Robert Haase, June 6th 2021; Marcelo Zoccoler, updated on December 10th 2021

The Image Data Resource (IDR) is an online database of microscopy research image data where scientist can publish their data if it is part of a scientific publication. It is a fantastic resource not just for biologists searching for images of samples they are interested in. It is also a fantastic source of data for image data scientists who develop new algorithms. For automated access of the underlying data base, an application programming interface (API) is accessible via python allowing you to programmatically browse the database, search for images with certain properties and download them for dedicated image analysis. For downloading images from the IDR, you only need a link, e.g. for requesting the data in tif format. You can then use scikit-image to open the image. In this blog post we show how to browse the IDR programmatically in Python. The procedures shown here will also work with your local Omero installation if you have one.

Some of the code examples shown below were adapted from the IDR API website licensed by the University of Dundee & Open Microscopy Environment under the Creative Commons Attribution 4.0 International License.

In the following example, we download image data from Stojic et al shared under the CC BY 4.0 license available from the IDR. See also the related publication.

Downloading a single image#

On the IDR website, we can navigate inside the screen dataset and click on images. After selecting an image, there will be download link in the top right corner. img_1.png

You can copy this link, change it a little and use it in your python code to download and show the image.

from import imread, imshow

original_link = ''
edited_link = ''

image = imread(edited_link)



This also works from Google Colab.


Furthermore, you can assemble the link from a generic link if you know the image identifier of the image you want to download. You can see the identifier of the image on the bottom of your browser when hovering with the mouse over the download link:


Using pythons string format function, we can assemble a generic unified resource locator (URL) with the specific image identifier to a specific link:

generic_image_url = "{image_id}/"
image_id = 9629351

# combine generic url with image ID
image_url = generic_image_url.format(**{"image_id":image_id})

# download and show image
image = imread(image_url)