dmipy allows direct download of HCP data by connecting directly to Amazon Web Services with your own credentials. First, you need to follow the following instruction to get your AWS credentials:
https://wiki.humanconnectome.org/display/PublicData/How+To+Connect+to+Connectome+Data+via+AWS
Then, you can open the interface to the AWS serves as follows:
from dmipy.hcp_interface import downloader_aws
public_aws_key = 'your public aws key'
secret_aws_key = 'your secret aws key'
hcp_interface = downloader_aws.HCPInterface(
your_aws_public_key=public_aws_key,
your_aws_secret_key=secret_aws_key)
If your credentials are correct this will not give you an authorization error.
You can then automatically download subject 100307 of the Wu-Minn HCP data (the one we chose to illustrate the dmipy examples) and save a coronal slice for the dmipy example notebooks. The data location is automatically chosen by the system.
hcp_interface.download_and_prepare_dmipy_example_dataset()
Downloading data to /user/rfick/home/.cache/Python-Eggs/dmipy-0.1.dev0-py2.7.egg-tmp/dmipy/data/hcp/100307 Downloading bvals Downloading bvecs Downloading data.nii.gz Downloading nodif_brain_mask.nii.gz Preparing coronal slice for dmipy examples Done
You can also download any other HCP subject by putting another valid subject number.
available_hcp_subjects = hcp_interface.available_subjects
available_hcp_subjects
array([100206, 100307, 100408, ..., 994273, 995174, 996782])
hcp_interface.download_subject(subject_ID=available_hcp_subjects[0])
Downloading data to /user/rfick/home/.cache/Python-Eggs/dmipy-0.1.dev0-py2.7.egg-tmp/dmipy/data/hcp/100206 Downloading bvals Downloading bvecs Downloading data.nii.gz Downloading nodif_brain_mask.nii.gz