How do I download reference atlas images?

You can view our reference atlases online at atlas.brain-map.org, but what if you want to download the images from an atlas (or SVG polygons describing the structures in one of an atlas’ sections)? What if you want to download these data for a whole atlas? There are a couple of ways to go about this:

1. using the AllenSDK

We recommend that you download atlas images using the AllenSDK, a Python package containing tools for accessing and using our data. Using the AllenSDK lets you easily download and organize many atlas images or SVG. Please see the notebook of image download examples for more information. If you run into problems using the AllenSDK, let us know on the AllenSDK’s Github page.

2. using our API

We make these images and SVG available through our web API. Please see the image download instructions and the svg download instructions for more information.

Another post related to this topic is here.

2 Likes

I’m new to the whole concept of API and i’m having trouble downloading the images i want. For example i want to download an image from Aging, Dementia and TBI atlas (lets say specimen number H14.09.010) and i want the original image of amyloid beta IHC FFPE expression in the hippocampus. How would the API link look like? I just can’t find the right link and the examples on image download instructions don’t help either.

Thank’s for the reply and sorry if it this is something simple, but i’m really having a hard time with this.

Hi Zaki,

Welcome to the forum!

TLDR: here is a jupyter notebook with code that downloads the image you want.

I think of this problem as having four subtasks:

  1. ask our public api for all of the sub_images associated with the donor named H14.09.010. To get this, we have to traverse a few layers of association: donors -> specimens -> data sets -> sub images.
  2. build a table of sub_images that lists the name of the imaged structure (e.g. hippocampus), the treatment applied (e.g. IHC:a-beta (FFPE)), and the ids of any corresponding sub_images (we need these to actually do the download). I chose to do this part in Python.
  3. query this table for the structure & treatment combination that we are interested in.
  4. actually download the image(s). This is where code in the image download notebook comes in.

Thanks for writing,
Nile

1 Like

Thanks very much Nile! It worked!!!
I only have a question about obtaining the original size, i.e. raw image file. Do i then type downsample=1 instead of 2?

1 Like

Awesome!

The downsample parameter specifies the number of times to downsample the image by a factor of 2 along each axis (this is documented here). If you want a full-size image you need to set downsample=0 (watch out - these can end up being pretty big).

EDIT: download -> downsample

Ok, thanks again! :slight_smile: