Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For the HCP 500 1200 Release, unprocessed and processed data for a subject can be accessed via REST calls apart from using other modes such as Connectome In a Box, Aspera, Amazon AWS. 

...

Details about file and folder organization are available here.

USAGE

To download a particular file, say the minimally processed file, T1w_acpc_dc_restore_1.25.nii.gz, for a subject, say 100307, you could invoke curl as:

Code Block
curl -u DB_LOGIN_ID_HERE:DB_PASSWORD_HERE -O
https://db.humanconnectome.org/data/archive/projects/HCP_5001200/subjects/100307/experiments/100307_CREST/resources/100307_CREST/files/T1w/T1w_acpc_dc_restore_1.25.nii.gz

...

The URI to get any file, for the subject 100307 in the HCP 500 1200 Release, would begin with:

Code Block
https://db.humanconnectome.org/data/archive/projects/HCP_5001200/subjects/100307/experiments/100307_CREST/resources/100307_CREST/files

...

Code Block
https://db.humanconnectome.org/data/archive/projects/HCP_5001200/subjects/100307/experiments/100307_CREST/resources/100307_CREST/files/MNINonLinear/Results/rfMRI_REST1_LR/rfMRI_REST1_LR_Atlas.dtseries.nii

...

Code Block
languagebash
linenumberstrue
DBHOST=https://db.humanconnectome.org
PROJECT=HCP_5001200
REST_URL_PREFIX=$DBHOST/data/archive/projects/$PROJECT/subjects
##################################################################################################################
#
# GET a jsession
#
#
# Set 
#
# MY_CURL_OPTIONS: Options that you may want to pass to curl such as --connect-timeout, --retry etc
# db_user: ConnectomeDB login id
# db_password: ConnectomeDB password
#
#
# subject_list_file: A File containing list of subject IDs
#
##################################################################################################################

jsession=`curl $MY_CURL_OPTIONS -u $db_user:$db_password $DBHOST`

while read line
do
      subject=$line
      subject_url_prefix=$REST_URL_PREFIX/$subject/experiments/${subject}_CREST/resources/${subject}_CREST/files
      file_relative_path=MNINonLinear/Results/rfMRI_REST1_LR/rfMRI_REST1_LR_Atlas.dtseries.nii
      curl $MY_CURL_OPTIONS -b "JSESSIONID=$jsession" -O $subject_url_prefix/$file_relative_path 
done < $subject_list_file

...