dipy icon indicating copy to clipboard operation
dipy copied to clipboard

NF: DKI+ constraints

Open tomdelahaije opened this issue 2 years ago • 5 comments

This request implements the DKI+ constraints proposed in https://doi.org/10.1016/j.neuroimage.2019.116405. The constraints can be used by setting fit_method='CLS' (constrained ordinary least squares) or fit_method='CWLS' (constrained weighted least squares). The implementation can be tested by following the DKI example in the documentation (https://dipy.org/documentation/1.4.1./examples_built/reconst_dki), and running for example

dkimodel_plus = dki.DiffusionKurtosisModel(gtab, fit_method='CWLS')
dkifit_plus = dkimodel_plus.fit(data_smooth, mask=mask)

It is recommended to use the MOSEK solver for speed by setting cvxpy_solver='MOSEK', cf. https://docs.mosek.com/latest/install/installation.html for installation.

The implementation of these constraints is essentially identical to the implementation provided by #2531 for MAP-MRI.

One point: the SCS solver that CVXPY uses by default is more stable and gives more accurate results when the b-values are given in natural units [ms / micron^2], essentially dividing the b-values by 1000 when they are given in standard units of [s / mm^2]. Is there a recommended way of using these natural units when setting up a gradient table, or should I just try to rescale the gradients in the fitting function?

tomdelahaije avatar May 31 '22 13:05 tomdelahaije

Hello @tomdelahaije, Thank you for updating !

Cheers ! There are no PEP8 issues in this Pull Request. :beers:

Comment last updated at 2022-09-09 13:06:11 UTC

pep8speaks avatar May 31 '22 13:05 pep8speaks

Codecov Report

Merging #2609 (ca102ce) into master (f9dd0f5) will decrease coverage by 0.41%. The diff coverage is 80.72%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2609      +/-   ##
==========================================
- Coverage   83.92%   83.51%   -0.41%     
==========================================
  Files         132      135       +3     
  Lines       18479    18994     +515     
  Branches     3047     3106      +59     
==========================================
+ Hits        15508    15863     +355     
- Misses       2228     2359     +131     
- Partials      743      772      +29     
Impacted Files Coverage Δ
dipy/core/optimize.py 79.06% <0.00%> (+2.59%) :arrow_up:
dipy/reconst/utils.py 96.00% <ø> (ø)
dipy/viz/plotting.py 7.22% <0.00%> (-0.18%) :arrow_down:
dipy/reconst/dki.py 94.49% <85.71%> (-1.90%) :arrow_down:
dipy/reconst/dki_micro.py 91.60% <100.00%> (-0.70%) :arrow_down:

... and 9 files with indirect coverage changes

codecov[bot] avatar May 31 '22 14:05 codecov[bot]

Hi @tomdelahaije,

Can you give us an update on this? thank you!

skoudoro avatar Aug 30 '22 14:08 skoudoro

Hi @tomdelahaije,

Can you give us an update on this? thank you!

Hi @skoudoro

Sorry for the delay, there were some developments on the theory side of this that required some work. I'll get back to you with an update later today.

tomdelahaije avatar Sep 07 '22 08:09 tomdelahaije

Ok, no problem, thank you for the feedback.

skoudoro avatar Sep 07 '22 08:09 skoudoro

@tomdelahaije, in our lab, we would like to use your method to calculate kurtosis maps. Is this code reliable or would you recommend using another implementation? Thanks for the great work!

kerkelae avatar Feb 01 '23 09:02 kerkelae

@tomdelahaije can you update this PR? Many people want to use it asap. We can also highlight it during the upcoming workshop http://dipy.org/workshops/latest

Garyfallidis avatar Mar 22 '23 23:03 Garyfallidis

PR updated, thanks @tomdelahaije for your help!

It would be great if @kerkelae or @RafaelNH or @arokem could look at this and give feedback.

I think I might go ahead and merge this nice features tomorrow if there are no additional comments.

skoudoro avatar Apr 19 '23 19:04 skoudoro

Congratulations @tomdelahaije !!! Another great + technique merged!

Garyfallidis avatar Apr 20 '23 21:04 Garyfallidis

@kerkelae and all please start using this method and provide feedback to @tomdelahaije !

Garyfallidis avatar Apr 20 '23 21:04 Garyfallidis

@Garyfallidis I've been using the code from @tomdelahaije's own branch for a while now and everything has been working well! Thanks for making it a part of DIPY. This is a really valuable contribution.

kerkelae avatar Apr 23 '23 13:04 kerkelae