Skip to content

Commit

Permalink
Fetcher for ivim data, needs md5
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahnawaz Ahmed committed Jun 12, 2016
1 parent 0296f97 commit a9f71cd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dipy/data/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,14 @@ def fetcher():
doc="Download 2 subjects from the SNAIL dataset with their bundles",
unzip=True)

fetch_ivim = _make_fetcher(
"fetch_ivim",
pjoin(dipy_home, 'ivim'),
'https://ndownloader.figshare.com/files/',
['5305243', '5305246', '5305249'],
['ivim.nii.gz', 'ivim.bval', 'ivim.bvec'],
doc="Download IVIM dataset")


def read_scil_b0():
""" Load GE 3T b0 image form the scil b0 dataset.
Expand Down Expand Up @@ -839,3 +847,22 @@ def read_bundles_2_subjects(subj_id='subj_1', metrics=['fa'],
res[bun] = streamlines

return res

def read_ivim():
""" Load IVIM dataset
Returns
-------
img : obj,
Nifti1Image
gtab : obj,
GradientTable
"""
files, folder = fetch_ivim()
fraw = pjoin(folder, 'ivim.nii.gz')
fbval = pjoin(folder, 'ivim.bval')
fbvec = pjoin(folder, 'ivim.bvec')
bvals, bvecs = read_bvals_bvecs(fbval, fbvec)
gtab = gradient_table(bvals, bvecs)
img = nib.load(fraw)
return img, gtab

0 comments on commit a9f71cd

Please sign in to comment.