fury-gl / fury

FURY - Free Unified Rendering in pYthon.
https://fury.gl
Other
226 stars 165 forks source link

DTI uncertainty visualization #810

Closed tvcastillod closed 4 months ago

tvcastillod commented 1 year ago

Hi, this PR aims to give the possibility to visualize the uncertainty in the DTI model.

Because the DTI visualization pipeline is quite complex, a level of uncertainty arises, which if visualized, could help to assess the accuracy of the model. The selected method is based on first-order matrix perturbation analysis and is described here. The idea is to examine the uncertainty in the eigenvalues and eigenvectors, to estimate and visualize the variance of the main direction of diffusion, which is represented with symmetrical cones, allowing for the visualization of the diffusion direction and confidence interval simultaneously.

Other sources include 1 and 2, which give a slightly more detailed description of the uncertainty calculation.

  1. Variance of estimated DTI-derived parameters via first-order perturbation methods [see appendix B]
  2. Theoretical analysis of the effects of noise on diffusion tensor imaging [see appendix D]
skoudoro commented 1 year ago

That is an exciting feature !!! Please, let us know when it is ready for reviews/questions

tvcastillod commented 11 months ago

@skoudoro @guaje I made the changes that were discussed, now you can do a first review.

skoudoro commented 11 months ago

Also, tests are failing with this new function, Please, Can you look deeper what is going on ? we have a segfault in one of your shader

codecov[bot] commented 11 months ago

Codecov Report

Merging #810 (d555495) into master (2bba1b9) will increase coverage by 0.20%. Report is 184 commits behind head on master. The diff coverage is 92.77%.

:exclamation: Current head d555495 differs from pull request most recent head 022a73b. Consider uploading reports for the commit 022a73b to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #810      +/-   ##
==========================================
+ Coverage   84.33%   84.54%   +0.20%     
==========================================
  Files          44       44              
  Lines       10356    10529     +173     
  Branches     1410     1418       +8     
==========================================
+ Hits         8734     8902     +168     
- Misses       1252     1255       +3     
- Partials      370      372       +2     
Files Coverage Δ
fury/actor.py 85.60% <87.50%> (+0.01%) :arrow_up:
fury/actors/tensor.py 96.39% <94.02%> (-3.61%) :arrow_down:

... and 4 files with indirect coverage changes

skoudoro commented 11 months ago

Hi @tvcastillod, What is the status concerning this PR and other reviews ? thank you for the feedback

tvcastillod commented 10 months ago

@guaje @skoudoro I addressed all the comments, you can take another look to verify that everything is correct.

pep8speaks commented 8 months ago

Hello @tvcastillod, Thank you for updating!

Line 425:74: W605 invalid escape sequence '\D' Line 426:49: W605 invalid escape sequence '\T' Line 427:40: W605 invalid escape sequence '\e' Line 427:51: W605 invalid escape sequence '\D' Line 427:57: W605 invalid escape sequence '\e' Line 428:34: W605 invalid escape sequence '\e' Line 432:9: W605 invalid escape sequence '\T' Line 432:25: W605 invalid escape sequence '|' Line 432:27: W605 invalid escape sequence '\D' Line 432:33: W605 invalid escape sequence '\e' Line 432:43: W605 invalid escape sequence '|' Line 471:22: E127 continuation line over-indented for visual indent

To test for issues locally, pip install flake8 and then run flake8 fury.