Hi Ben, See if this post sheds some light on your query:
https://www.mail-archive.com/[email protected]/msg01037.html Haven't had to do this myself yet, but it looks handy. Donna On Jun 13, 2015, at 3:20 AM, Ben Cipollini <[email protected]> wrote: > For the first issue, I'm guessing this is due to the following boto bug: > https://github.com/boto/boto/issues/3006 > Below is an example script for accessing HCP resources via Python. Thanks to > Ariel Rokem for help figuring this out! > > If anybody can help with an example XNAT URL for accessing all files of a > particular subject, that would be greatly appreciated! > > Ben > > > # Read about AWS boto here: http://boto.readthedocs.org/en/latest/ > import boto > s3 = boto.connect_s3(profile_name='hcp') > buck = s3.get_bucket('hcp-openaccess') > with open('S500.txt', 'wb') as fp: > buck.get_key('HCP/S500.txt').get_file(fp) # downloads contents to a > local file > > Note: ~/.aws/credentials contains: > [hcp] > aws_access_key_id = [my_hcp_access_key] > aws_secret_access_key = [my_hcp_secret_key] > > > > > On Fri, Jun 12, 2015 at 2:30 PM, Ben Cipollini <[email protected]> wrote: > Hi, > > I'm trying to access HCP files via scripting. I know the directory structure > through the appendix III definitions. However, I am not sure how to access > the resources through XNAT nor Amazon S3. > > > In XNAT, I can't figure out what URL to construct to access any file. For > example, what would be the URL to access the file > 100307/tfMRI_EMOTION_LR/100307/tfMRI_EMOTION_LR/100307_3T_tfMRI_EMOTION_LR.nii.gz > ? > > > Alternately, I'm trying to access the Amazon S3 files through Amazon's boto > package. I can open a connection with my S3 credentials, and I see a > "hcp-openaccess" bucket. When I try to list the bucket contents (for file_key > in bucket.list(): print file_key), I get access denied. > > Has anybody tried accessing the S3 data in this way that can share an example > script? Or any suggestions for other ways to script the access? > > > Thanks, > Ben > > _______________________________________________ > HCP-Users mailing list > [email protected] > http://lists.humanconnectome.org/mailman/listinfo/hcp-users > _______________________________________________ HCP-Users mailing list [email protected] http://lists.humanconnectome.org/mailman/listinfo/hcp-users
