# How do I download reference atlas images?

**URL:** <https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94>\
**Category:** Technical\
**Tags:** how-to, atlas-reference-maps, allensdk\
**Created:** [February 2, 2019, 1:10am UTC](https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94 "2019-02-02T01:10:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nileg](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/nileg/32/39_2.png) [@nileg](https://community.brain-map.org/u/nileg)\
**Post date:** [February 2, 2019, 1:10am UTC](https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94/1 "2019-02-02T01:10:53Z")

</div>

You can view our reference atlases online at [atlas.brain-map.org](http://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](http://allensdk.readthedocs.io), 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](https://allensdk.readthedocs.io/en/latest/_static/examples/nb/image_download.html) for more information. If you run into problems using the AllenSDK, let us know on [the AllenSDK’s Github page](http://github.com/alleninstitute/allensdk).

### 2. using our API

We make these images and SVG available through our web API. Please see the [image download instructions](http://help.brain-map.org/display/api/Downloading+an+Image) and the [svg download instructions](http://help.brain-map.org/display/api/Downloading+and+Displaying+SVG) for more information.

_Another post related to this topic is [here](https://community.brain-map.org/t/faq-how-can-i-get-a-printed-or-pdf-version-of-the-mouse-human-brain-reference-atlas/411)._

---

<div class="post-metadata">

**Author:** ![Zaki](https://avatars.discourse-cdn.com/v4/letter/z/ee59a6/32.png) [@Zaki](https://community.brain-map.org/u/Zaki)\
**Post date:** [April 23, 2019, 8:33pm UTC](https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94/2 "2019-04-23T20:33:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nileg](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/nileg/32/39_2.png) [@nileg](https://community.brain-map.org/u/nileg)\
**Post date:** [April 24, 2019, 6:44pm UTC](https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94/3 "2019-04-24T18:44:13Z")

</div>

Hi Zaki,

Welcome to the forum!

TLDR: [here is a jupyter notebook with code that downloads the image you want](https://gist.github.com/NileGraddis/9f96c2c5340d3a6e0f7997047fff7cfc).

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](https://allensdk.readthedocs.io/en/latest/_static/examples/nb/image_download.html) comes in.

Thanks for writing,  
Nile

---

<div class="post-metadata">

**Author:** ![Zaki](https://avatars.discourse-cdn.com/v4/letter/z/ee59a6/32.png) [@Zaki](https://community.brain-map.org/u/Zaki)\
**Post date:** [April 24, 2019, 7:47pm UTC](https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94/4 "2019-04-24T19:47:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![nileg](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/nileg/32/39_2.png) [@nileg](https://community.brain-map.org/u/nileg)\
**Post date:** [April 24, 2019, 8:24pm UTC](https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94/5 "2019-04-24T20:24:50Z")

</div>

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](https://allensdk.readthedocs.io/en/latest/_static/examples/nb/image_download.html#Downloading-a-single-Mouse-Brain-Section-image)). 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

---

<div class="post-metadata">

**Author:** ![Zaki](https://avatars.discourse-cdn.com/v4/letter/z/ee59a6/32.png) [@Zaki](https://community.brain-map.org/u/Zaki)\
**Post date:** [April 25, 2019, 3:36am UTC](https://community.brain-map.org/t/how-do-i-download-reference-atlas-images/94/6 "2019-04-25T03:36:35Z")

</div>

Ok, thanks again! 🙂
