Commit c799a779 authored by Franziska Koehn's avatar Franziska Koehn
Browse files

download-function for one result added

parent ce2929d5
HOST = None
def main(host):
import distutils.core
......@@ -53,14 +54,22 @@ def get_query_methods():
def get_operators():
return ["LIKE", ">", "<", "<=", ">=", "="]
def download_all(results, host):
def download_all(results, host=None):
for r in results:
subject = r['xnat_mrsessiondata_subject_id']
experiment = r['xnat_mrsessiondata_session_id']
project = r['xnat_mrsessiondata_project']
scan = r['id']
file_name = "%s_%s_%s" % (subject, r['type'], scan)
download_file(host, project, subject, experiment, scan, file_name)
download(r, host)
def download(result, host=None):
if not host:
host = HOST
subject = result['xnat_mrsessiondata_subject_id']
experiment = result['xnat_mrsessiondata_session_id']
project = result['xnat_mrsessiondata_project']
scan = result['id']
file_name = "%s_%s_%s" % (subject, result['type'], scan)
download_file(host, project, subject, experiment, scan, file_name)
return False
def search_for_mrScanData(host, constraints, user, passw):
get_credentials(username=user, password=passw)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment