Closed harangju closed 4 years ago
Some information on how to use and factor our parameters as configuration files:
import configparser import os
params = configparser.ConfigParser() params_furl = os.path.join(experiment_path, 'conf', 'experiment.ini')
params.read(params_furl)
params.add_section('FILE') params.set('FILE', 'experiment_path', experiment_path) params.set('FILE', 'experiment_name', name)
the experiment file would read, for example:
[TIME_SERIES] horizon = 15 guard_front = 4 guard_back = 4
[FMRI] tr = 0.72 physio_sampling_rate = 400 regress_physio = False
[PARCELLATION] parcellation = aparc
[SURFACE] inflation = inflated
[SESSION] train = MOTOR_LR test = MOTOR_LR
[LOGGING] experiment_level = info monitor_level = info
to work with a subjects.txt file found at the path and filename given by list_url, you can do:
def load_subject_list(list_url): with open(list_url, 'r') as f: subjects = [s.strip() for s in f.readlines()] return subjects
Take a look at the following, in dataset/hcp/downloaders.py, class HcpDownloader, method load
there, you will have information on how to assemble the http download request from the HCP database, including the credentials, for example
r = requests.get(url,
auth=(self.settings['CREDENTIALS']['hcp_server_username'],
self.settings['CREDENTIALS']['hcp_server_password']),
stream=True)
downloader downloads raw data
See here: https://github.com/lindenmp/antsDTOrientationTests