This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, json | |
import os | |
# | |
# Example python code to download atlas svg files | |
# | |
# Read the Allen Brain Atlas API documentation: | |
# http://help.brain-map.org/display/api/Atlas+Drawings+and+Ontologies | |
# | |
# In the table find the atlas that you looking for. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, json | |
import os | |
# | |
# Example python code to download atlas background images | |
# | |
# Read the Allen Brain Atlas API documentation: | |
# http://help.brain-map.org/display/api/Atlas+Drawings+and+Ontologies | |
# | |
# In the table find the atlas that you looking for. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, json | |
import os | |
# | |
# Example python code to download images from an image series | |
# | |
# Find the image series you want from the Allen Brain Atlas portal | |
# Take a note of the dataset id | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, json | |
import os | |
import xml.etree.ElementTree as ET | |
# | |
# Example python code to break up an atlas svg by structure | |
# | |
# Read the Allen Brain Atlas API documentation: | |
# http://help.brain-map.org/display/api/Atlas+Drawings+and+Ontologies | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://api.brain-map.org/api/v2/data/query.csv?criteria=model::Structure, | |
rma::criteria,[ontology_id$eq1], | |
rma::options[order$eq%27structures.graph_order$asc%27][num_rows$eqall] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import os | |
import pandas as pd | |
import numpy as np | |
import nrrd | |
# | |
# Example code to get all unique ID in CCF annotation volume | |
# and match them up to structure acronyms | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import nibabel as nib | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
# | |
# Example python code to plot microarray sample on MRI image | |
# and replicate an instance of the planar view | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://api.brain-map.org/api/v2/data/query.xml?criteria= | |
model::AtlasImage | |
, | |
rma::criteria, | |
[annotated$eqtrue],atlas_data_set(atlases[id$in181276165,181276164,181276162,181276160,181276151,181276130,181275741]) | |
, | |
rma::include, | |
atlas_data_set(atlases) | |
,rma::options | |
[only$eq'atlases.name,atlases.id,data_sets.section_thickness,sub_images.section_number,sub_images.id'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Bucket Organization | |
# | |
''' | |
allen_mouse_brain_atlas | |
+-- manifest.json # for later integration with AllenSDK | |
+-- section_data_sets.json # high level metadata for each section data set | |
+-- section_data_set_<section_data_set_id> | |
¦ +-- section_data_set.json # detailed metadata for each section data set | |
¦ +-- downsample_<downsample_factor> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SimpleITK as sitk | |
import numpy as np | |
import pandas as pd | |
# downloaded from http://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/ccf_2017/ | |
filename = 'annotation_25.nrrd' | |
itkimage = sitk.ReadImage(filename) | |
print(itkimage) | |
numpyImage = sitk.GetArrayFromImage(itkimage) |
OlderNewer