Skip to content

Commit

Permalink
parametrize download
Browse files Browse the repository at this point in the history
  • Loading branch information
anibalsolon committed Apr 21, 2020
1 parent 7d65261 commit 1d971ce
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions download_abide.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Data download
Usage:
download_abide.py [--pipeline=cpac] [--strategy=filt_global] [<derivative> ...]
download_abide.py (-h | --help)
Options:
-h --help Show this screen
--pipeline=cpac Pipeline [default: cpac]
--strategy=filt_global Strategy [default: filt_global]
derivative Derivatives to download
"""


import os
import urllib
import urllib.request
from docopt import docopt



Expand Down Expand Up @@ -56,11 +74,15 @@ def collect_and_download(derivative, pipeline, strategy, out_dir):

if __name__ == "__main__":

derivatives = ["rois_aal", "rois_cc200", "rois_dosenbach160", "rois_ez", "rois_ho", "rois_tt"]
pipeline = "cpac"
strategy = "filt_global"
arguments = docopt(__doc__)

if not arguments['<derivative>']:
arguments['<derivative>'] = ['rois_aal', 'rois_cc200', 'rois_dosenbach160', 'rois_ez', 'rois_ho', 'rois_tt']

pipeline = arguments.get('pipeline', 'cpac')
strategy = arguments.get('strategy', 'filt_global')

out_dir = os.path.abspath("data/functionals/cpac/filt_global/")

for derivative in derivatives:
for derivative in arguments['<derivative>']:
collect_and_download(derivative, pipeline, strategy, os.path.join(out_dir, derivative))

0 comments on commit 1d971ce

Please sign in to comment.