This script can download the HCP dataset automatically.
subjects.txt - subjects number list
Please look at boto3 Docs.
First, boto3 should be downloaded.
pip install boto3
If you have the AWS CLI installed, then you can use it to configure your credentials file.
aws configure
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY
The key come from HCP dataset, and you should click the button of 'Amazon S3 Access enabled'.
In this script, I want to download some files whose name include _RL.nii.gz
or _LR.nii.gz
in HCP_1200/{$subject_number}/MNINonLinear/Results/tfMRI*
.
You can change the keyList = bucket.objects.filter(Prefix = {$your_filter})
to filter files.
And, you can change the trycnt
variable to change the number of retry.
If you meet any problems, please touch with me.
Email: huaweilin.cs@gmail.com
⭐Give it a star if you like it.⭐