Downloading Images

The ImageDownloadApi class in the AllenSDK provides a Python interface for accessing image data produced by the Allen Institute for Brain Science.


Reference Documentation:

Download this file in .ipynb format here.

We will want to look at the images we download in this notebook. Here are a couple of functions that do this:

Finally, we will need an instance of ImageDownloadApi and an instance of SvgApi:

Downloading a single Mouse Brain Section image

In this example, we will download a single section image from Mouse Brain Atlas experiment 71210895.

For now, we'll assume that we already know the id (unique integer identifier) of the image that we wish to download. In a later section, we'll use our ImageDownloadApi instance to find the ids of all the images from a particular experiment.

The raw images can be quite large, so we will download downsampled versions. The downsample keyword argument reduces the size of the obtained image by a factor of $2^{\text{downsample}}$ along each axis.

Now we download the image using our api object and view it in the notebook.