Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IVIM #1058

Merged
merged 96 commits into from Sep 27, 2016
Merged

IVIM #1058

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
11b2700
Initial ivim simulations and tests
May 25, 2016
951c19f
fixes for tests
May 25, 2016
5e19275
testing with Federau values
May 26, 2016
b8570fb
initial guess added
May 26, 2016
49eaad3
Removed redundant imports
May 30, 2016
449f119
Added guess parameters as keyword to fit method
May 30, 2016
1ce3c3d
Added tests for multivoxel fit and guess
May 30, 2016
c955cab
pass S0 to multi_tensor
May 30, 2016
834c2da
Replaced nlls with leastsq, en route to two stage fit
Jun 2, 2016
00a485d
fixed import error
Jun 2, 2016
0cae14b
minimize as the fit function
Jun 2, 2016
3f23734
Added bounds and other params for fit
Jun 4, 2016
f7e7823
leastsq is back
Jun 5, 2016
f51b297
Added tolerances for minimize
Jun 9, 2016
02c3f2c
Implemented two stage fitting
Jun 9, 2016
d65b1f8
Tests for two stage, optimize omitted
Jun 9, 2016
41820ac
Generate b vectors using disperse_charges
Jun 2, 2016
4bac6e9
Fetcher for ivim data, needs md5
Jun 12, 2016
ae90bd1
x0 should be flattened
quantshah Jun 14, 2016
927e981
Added read_ivim to __init__
quantshah Jun 15, 2016
762c34e
Example for the ivim module
quantshah Jun 15, 2016
bd59df4
Use dipy.core.optimize for optimization
quantshah Jun 15, 2016
fc44889
added f guess
quantshah Jun 15, 2016
27bb444
Some edits to test parameters
quantshah Jun 15, 2016
f8a89a4
f_guess = 1 - S/S_
quantshah Jun 15, 2016
c74ad47
Resolved conflict in generate_bvecs
Jun 20, 2016
78ba6ff
One stage fitting works with optimize
Jun 20, 2016
84d302d
Error function returns only residual, sq in minimize
Jun 20, 2016
38f4bf0
D* guess is 10 timens D, added S0 estimation from dti
Jun 20, 2016
230ce3e
Added predict and test for predict
Jun 20, 2016
5437825
Guess f using DTI
Jun 21, 2016
de22db5
Tests for two stage
Jun 21, 2016
a431db3
f guess update
Jun 22, 2016
f6a9574
pep-8 for predict
quantshah Jun 23, 2016
fe0c406
Merge branch 'master' of https://github.com/nipy/dipy into ivim_dev
quantshah Jun 23, 2016
93ba045
Upper bound for S0 is not 1
quantshah Jun 24, 2016
61e4ac5
Use generate_bvecs from gradients
quantshah Jun 24, 2016
4826103
Flatten x0 and add guess for S0 as S(b=0)
quantshah Jun 24, 2016
7951e6b
S0 values according to real data
quantshah Jun 24, 2016
7885c7f
Separate func for D_guess
quantshah Jun 24, 2016
7bae1a4
Changed test parameters
quantshah Jun 24, 2016
d1c933b
Added maxiter for scipy version less than 0.12
quantshah Jun 27, 2016
e08d62f
Updated fetcher init for better coverage
quantshah Jun 27, 2016
4a9c1a5
jac keyword argument should be None
quantshah Jun 28, 2016
0407072
Added Jacobian
quantshah Jun 28, 2016
8118407
Corrected the -ve sign in derv
quantshah Jun 28, 2016
f581f3e
Added the test with Jacobian
quantshah Jun 28, 2016
2c8f244
Updated examples, using two_stage and gray colormap
quantshah Jun 29, 2016
d56e525
Updating documentation
quantshah Jul 1, 2016
200162e
Added options keyword
quantshah Jul 6, 2016
ebea630
Pre allocation of result array
quantshah Jul 6, 2016
a352e9a
Added fit statistics
quantshah Jul 7, 2016
a9f88e7
Changed fitting algorithm
quantshah Jul 7, 2016
40e5974
Removed minimize, improved Jacobian and two-stage guess
quantshah Jul 10, 2016
24f6240
Relative import to absolute
quantshah Jul 12, 2016
93fd782
S0 normalization added
quantshah Jul 12, 2016
655b3d4
Updated doc for test and removed unnecesary func in test
quantshah Jul 12, 2016
88a8464
One parameter for all and doc updates
quantshah Jul 12, 2016
7f9ddea
Updated example
quantshah Jul 12, 2016
a2be743
Added basic Jacobian test and fixed pep8
quantshah Jul 12, 2016
295dd88
least_squares for scipy==0.17
quantshah Jul 13, 2016
3d56fe6
Updated the Jacobian
quantshah Jul 13, 2016
ebba0f2
All initializations in IvimModel, updated examples
quantshah Jul 19, 2016
89efc60
Optimized the Jacobian function
quantshah Jul 19, 2016
af11496
Bounds for Scipy 0.17, test and example updated
quantshah Jul 21, 2016
6202f99
Refactoring of checks in init and more tests
quantshah Jul 21, 2016
8af6ef7
Pre initialize Jacbian array, lower thresholds
quantshah Jul 21, 2016
4d8b760
Documentation updates
quantshah Jul 21, 2016
3babc2c
Removed Jac, one stage, updated docs and example
quantshah Jul 21, 2016
89c39ae
bounds on f
quantshah Jul 21, 2016
00c0201
Major refactoring, used multi_voxel decorator, updated tests
quantshah Jul 22, 2016
4fe12ef
Moved all fitting in one class under fit
quantshah Jul 22, 2016
283d166
Tests for S0=1000
quantshah Jul 22, 2016
f28c609
Polishing final documentation
quantshah Jul 22, 2016
98af7b7
docstring of IvimModel init updated
quantshah Jul 27, 2016
ac34b78
Removed x0. Estimated by 'estimate_x0'
quantshah Jul 28, 2016
3e34b1c
Check unfeasible x0 values
quantshah Jul 28, 2016
fbff13a
Updated example and documentation
quantshah Aug 1, 2016
0d2fb35
Removed execution of fetcher in docstring for test_bounds
quantshah Aug 1, 2016
a78e9d9
Added sphinx code directive
quantshah Aug 1, 2016
31a784b
pep8 fixes
quantshah Aug 1, 2016
625b6a8
Added test statement for mask and bounds
quantshah Aug 1, 2016
80efaab
Added tests for predict, check_bounds and get_item
quantshah Aug 2, 2016
7d014d6
Test for get_item and shape
quantshah Aug 2, 2016
3f99e3f
Changed ivim function to predict with gtab as parameter.
quantshah Aug 2, 2016
5da4913
Interpolation set to None
quantshah Aug 2, 2016
2f9134d
replaced data[0] with mean of data[b0_mask]
quantshah Aug 2, 2016
295f987
Added functions for getting individual parameters
quantshah Aug 2, 2016
d38feca
Updated examples
quantshah Aug 2, 2016
ca13dee
removed unnecessary import
quantshah Aug 2, 2016
d21d90f
Updated example
quantshah Aug 2, 2016
3f2bdb3
Faster tests: Defined global fits
quantshah Aug 2, 2016
a6441b2
Estimate x0 using linear log fit
quantshah Aug 3, 2016
84cce70
Added test for multiple b0 signals
quantshah Aug 3, 2016
6913b8e
Added check and test for no b0 case
quantshah Aug 3, 2016
e07a989
Set interpolation to nearest for better visualization
quantshah Aug 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion dipy/data/__init__.py
Expand Up @@ -39,7 +39,9 @@
fetch_cenir_multib,
read_cenir_multib,
fetch_mni_template,
read_mni_template)
read_mni_template,
fetch_ivim,
read_ivim)

from ..utils.arrfuncs import as_native_array
from dipy.tracking.streamline import relist_streamlines
Expand Down
30 changes: 30 additions & 0 deletions dipy/data/fetcher.py
Expand Up @@ -392,6 +392,17 @@ 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'],
['cda596f89dc2676af7d9bf1cabccf600',
'f03d89f84aa9a9397103a400e43af43a',
'fb633a06b02807355e49ccd85cb92565'],
doc="Download IVIM dataset")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add to the doc "Download IVIM dataset consisting of an image, bvalue and bvector files"? Not sure how specific @arokem wants these to be tho.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the data_size as input?



def read_scil_b0():
""" Load GE 3T b0 image form the scil b0 dataset.
Expand Down Expand Up @@ -839,3 +850,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