Downloading ConWhAt Atlases

Import the fetcher function


In [34]:
from conwhat.utils.fetchers import fetch_conwhat_atlas
import glob

Define the output directory


In [ ]:
atlas_dir = '/scratch/hpc3230/Data/conwhat_atlases'

Define which atlas to grab


In [4]:
atlas_name = 'CWL2k8Sc33Vol3d100s_v01'

Break a leg


In [30]:
fetch_conwhat_atlas(atlas_name,atlas_dir,remove_existing=True);


removing existing folder


duplicate file detected - removing...
rm CWL2k8Sc33Vol3d100s_v01.zip


downloading data_file CWL2k8Sc33Vol3d100s_v01.zip...
wget https://www.nitrc.org/frs/download.php/10381/CWL2k8Sc33Vol3d100s_v01.zip


unzipping file...
unzip CWL2k8Sc33Vol3d100s_v01.zip


finished unzipping.

The zipped and unzipped atlas folders are now there in the top-level atlas directory;


In [35]:
glob.glob(atlas_dir + '/*')


Out[35]:
['/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01.zip',
 '/scratch/hpc3230/Data/conwhat_atlases/README.md']

The .zip file can be optionally removed automatically if desired.

volumetric atlas folders contain a small number of fairly small .txt files


In [36]:
glob.glob('%s/%s/*.txt' %(atlas_dir,atlas_name))


Out[36]:
['/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/region_mapping_fsav_rh.txt',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/weights.txt',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/mappings.txt',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/region_labels.txt',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/bounding_boxes.txt',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/hemispheres.txt',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/cortex.txt',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/region_mapping_fsav_lh.txt']

...and a larger number of nifti images; one for each atlas structure


In [38]:
glob.glob('%s/%s/*.nii.gz' %(atlas_dir,atlas_name))[:5]


Out[38]:
['/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/vismap_grp_7-64_norm.nii.gz',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/vismap_grp_23-30_norm.nii.gz',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/vismap_grp_65-69_norm.nii.gz',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/vismap_grp_55-70_norm.nii.gz',
 '/scratch/hpc3230/Data/conwhat_atlases/CWL2k8Sc33Vol3d100s_v01/vismap_grp_28-64_norm.nii.gz']

In [39]:
len(glob.glob('%s/%s/*.nii.gz' %(atlas_dir,atlas_name)))


Out[39]:
2445