Skip to content

Instantly share code, notes, and snippets.

count value
44658375 0
6931 1
7339 2
134366 6
70327 7
14877 9
130357 10
5559 12
14706 15
@lydiang
lydiang / download_adult_human_atlases.py
Created September 24, 2022 23:40
Example code to download the adult human atlas images and svg from the Allen API
import urllib.request
import json
import os
def fetch_atlas_metadata( atlas_id ) :
# RMA query to find images for atlas
query_url = "http://api.brain-map.org/api/v2/data/query.json?criteria=model::Atlas"
query_url += ",rma::criteria,[id$eq%d]" % (atlas_id)
query_url += ",rma::include,structure_graph(ontology),graphic_group_labels"