Skip to content

Commit c17ab4f

Browse files
committed
tst: add datalad import
1 parent 3c9ee07 commit c17ab4f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import hashlib
22
import os.path as op
33

4-
54
def md5sum(filename):
65
with open(filename, 'rb') as f:
76
return hashlib.md5(f.read()).hexdigest()
87

8+
99
def gen_heudiconv_args(datadir, outdir, subject, heuristic_file, xargs=None):
1010
heuristic = op.realpath(op.join(
1111
op.dirname(heudiconv.__file__),
1212
'..',
1313
'heuristics',
1414
heuristic_file))
15-
1615
args = ["-d", op.join(datadir, 'sourcedata/{subject}/*/*/*.tgz'),
1716
"-c", "dcm2niix",
1817
"-o", outdir,
@@ -28,7 +27,9 @@ def gen_heudiconv_args(datadir, outdir, subject, heuristic_file, xargs=None):
2827

2928
def fetch_data(tmpdir, subject):
3029
"""Fetches some test dicoms using datalad"""
31-
targetdir = op.join(tmpdir, 'QA')
30+
from datalad import api
31+
32+
targetdir = op.join(tmpdir, 'QA')
3233
api.install(path=targetdir,
3334
source='///dbic/QA')
3435
api.get('{}/sourcedata/{}'.format(targetdir, subject))

0 commit comments

Comments
 (0)